davidjamesherzog / videojs-shaka

Shaka player integration with video.js
MIT License
45 stars 18 forks source link

isBrowserSupported in videojs-shaka #57

Open andreydruz opened 2 years ago

andreydruz commented 2 years ago

Have you read the Tutorials? Yes

Have you checked for duplicate open issues here? Yes

What version of Shaka Player and videojs-shaka are you using? "videojs-shaka": "1.1.1",

Please ask your question Shaka have option to check shaka.Player.isBrowserSupported() https://shaka-player-demo.appspot.com/docs/api/tutorial-basic-usage.html Its needed to check if we can use shaka player or to use native player on ipad https://github.com/shaka-project/shaka-player

How can I check it on videojs-shaka?

I tried:

console.log(this.videoPlayer.tech_.player_.isBrowserSupported());
console.log(this.videoPlayer.tech_.shaka_.isBrowserSupported());

But its did not worked.

davidjamesherzog commented 2 years ago

@andreydruz - isBrowserSupported is a static function which is why you don't see it. You can just call it via shaka.Player. So adding something like this should work.

console.log(shaka.Player.isBrowserSupported())
davidjamesherzog commented 2 years ago

https://shaka-player-demo.appspot.com/docs/api/shaka.Player.html