vast-vmap icon indicating copy to clipboard operation
vast-vmap copied to clipboard

mediatype supported?

Open byangcs opened this issue 8 years ago • 1 comments

Hey man quick question. How could I check whether the media player supports a certain format? I see that you have the function getBestMedia which matches the closest width, height, and bitrate, but what if the player doesn't actually support a certain format?

Thanks!

screen shot 2016-01-25 at 8 06 44 pm

byangcs avatar Jan 26 '16 04:01 byangcs

Unless things have changed, you need to have a <video> element in order to check for video playback capabilities, and even then, all you get is a return value of "probably" at best. To do a more rigorous test, you would need to construct the video element, start playing, and listen for the canplay event. I decided not to do that inside the library code, as it would require a lot of browser support, and might even break the user's browsing experience unexpectedly (e.g., sound suddenly starts playing).

jonhoo avatar Jan 26 '16 04:01 jonhoo