Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
930 views
in Technique[技术] by (71.8m points)

video.js - videojs-chromecast does not play some of encrypted hls videos?

I am using videojs with for encrypted hls stream. I want to play video over chromecast so using https://github.com/silvermine/videojs-chromecast

Some of videos are not playing over chromecast, only shows chromecast icon over screen (screenshot attached) and doesn't give any error on console in browser.

Link 1 ( play over chromecast ) : https://rajnisdefaultvt.b-cdn.net/src/test-playing-rajnish-player.html

Link 2 ( doesn't play ) : https://RajnisdefaultVT.b-cdn.net/src/test-not-playing-rajnish-player.html

Only chromecast icon is showing on screen

Adding chromecast as

<script>
    window.SILVERMINE_VIDEOJS_CHROMECAST_CONFIG = {
       preloadWebComponents: true,
    };
</script>

<script src="https://cdn.jsdelivr.net/npm/@silvermine/videojs-chromecast@1.2.2/dist/silvermine-videojs-chromecast.min.js"></script>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@silvermine/videojs-chromecast@1.2.2/dist/silvermine-videojs-chromecast.css">

using videojs as

<script>
    (async function (window, videojs) {
        var options = {
            playbackRates: [0.5, 0.75, 1, 1.25, 1.5, 1.75, 2],
            width: window.innerWidth,
            preload: "auto",
            plugins: {
                httpSourceSelector: {
                    default: 'auto'
                },
                chromecast: {
                    // addButtonToControlBar: true //
                }
            },
            controls: true,
            techOrder: [ 'chromecast', 'html5' ]
        };
        
        var player = window.player = videojs("example-video", options);
        player.chromecast();

        videojs.options.hls.overrideNative = true;            
        player.hlsQualitySelector({
            displayCurrentQuality: true,
        });
        player.src({
            src : "https://stag.cdn2.mogiio.com/5f43a4de8a95fe7231af61bc/1610211402238_/playlist.m3u8", // not playing over chromecast
            // src: 'https://cdn2.mogiio.com/5f43a4de8a95fe7231af61bc/1609360862979____/playlist.m3u8', //playing over chromecast
            type: "application/x-mpegURL"
        });
    }(window, window.videojs));
</script>
question from:https://stackoverflow.com/questions/65645869/videojs-chromecast-does-not-play-some-of-encrypted-hls-videos

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)
Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...