VideoJS динамически меняет источник с начальным типом = 'application / x-mpegURL' в Windows 7 IE11 - PullRequest
0 голосов
/ 08 октября 2019

Я пытаюсь динамически изменить изначально указанный источник VideoJS с type = 'application / x-mpegURL'in Windows 7 IE11 (который не поддерживает поток HLS) на поддерживаемый (тип: "video / mp4") на "ВИДЕО: ОШИБКА: (КОД: 4 MEDIA_ERR_SRC_NOT_SUPPORTED) "внешний вид. Я пробовал разные подходы. Лучшее, чего я мог добиться - это успешно сменить источник на игровой. Однако, даже если новый источник инициализирован и может быть воспроизведен / приостановлен, все еще существуют следующие проблемы:

1.ProgressBar, vjs-duration / vjs-оставшееся время не обновляется, показывая продолжительность / оставшееся время -«NONE» (даже «player.duration ()» показывает правильное значение).

2. Слайдер управления прогрессом не может быть перемещен, текущее время не может быть изменено.

3. Управление воспроизведением(воспроизведение / пауза) не обновляется (всегда отображается значок «воспроизведение» независимо от состояния «воспроизведение» / «пауза»).

HTML

<video id="video"  class="video-js vjs-default-skin "  width="640" height="360" poster="https://bitmovin-a.akamaihd.net/content/sintel/poster.png"  controls preload="auto" 
data-setup='{"liveui": true, "autoplay": false}'>
<source src="https://bitdash-a.akamaihd.net/content/sintel/hls/playlist.m3u8", type='application/x-mpegURL' />
</video>

Case1:

 <script>
var player=videojs("video") 
player.on('error', function() {
console.log("error due to the unsupported format")
    //---attempt to change source
//player.reset();   
player.error(null);
player.src([
  { type: "video/mp4", src: "//vjs.zencdn.net/v/oceans.mp4" },
]); 
player.ready(function(){
player.on('loadedmetadata', function(){
console.log("player duration:",player.duration())
})});           
player.play();
});
</script>

Result from Case:1

Корпус: 2

 <script>
var player=videojs("video") 
player.on('error', function() {
console.log("error due to the unsupported format")
    //---attempt to change source
//player.reset();   
//player.error(null);
player.src([
  { type: "video/mp4", src: "//vjs.zencdn.net/v/oceans.mp4" },
]); 
player.ready(function(){
player.on('loadedmetadata', function(){
console.log("player duration:",player.duration());
player.error(null);
})});           
player.play();
});
</script>

enter image description here

Корпус: 3

    <script>
    var player=videojs("video") 
    player.on('error', function() {
    console.log("error due to the unsupported format")
        //---attempt to change source
    player.reset(); 
    //player.error(null);
    player.src([
      { type: "video/mp4", src: "//vjs.zencdn.net/v/oceans.mp4" },
    ]); 
    player.ready(function(){
    player.on('loadedmetadata', function(){
    console.log("player duration:",player.duration());
    //player.error(null);
    })});           
    player.play();
    });
    </script>

enter image description here

Что не так с моими кодами?

Video.js 7.6.5, Windows 7, IE11,

1 Ответ

0 голосов
/ 08 октября 2019

Это подтверждается video.js "ошибка". https://github.com/videojs/video.js/issues/6256

...