videojs/video.js

EventedMixin.off or Player.removeTechControlsListeners_ function has some logic error

オープン

#4,627 opened on 2017/09/21

 (2 件のコメント) (0 件のリアクション) (0 人の担当者)JavaScript (7,502 件のフォーク)batch import
confirmedhelp wanted

Repository metrics

Stars
 (39,742 個のスター)
PR merge metrics
 (平均マージ 111d 10h) (30d で 3 merged PRs)

説明

Description

EventedMixin.off function has some logic error, you can see the detail in steps to reproduce

Steps to reproduce

1.Player: this.tech_ is undefined when this highlight statement run image

2.EventedMixin.off : if targetOrType undefined and typeOrListener is eventType, I think the parameters adaptation logic is not handled in the right way image

3.Events.of pass the wrong parameters image

Results

Expected

remove the specified event type and listener

Actual

remove all player listener

Error output

no error output

Additional Information

<link href="../../../dist/video-js.css" rel="stylesheet">
<script src="../../../dist/ie8/videojs-ie8.js"></script>
<script src="../../../dist/video.js"></script>

<video id="player1" class="video-js vjs-default-skin" controls preload="auto" height="320" playsinline webkit-playinline>
</video>
<script>
    var player = videojs('player1',{
      sources: [{
        src: '//www.streambox.fr/playlists/x36xhzz/x36xhzz.m3u8',
        type: 'application/x-mpegURL'
      }]
    });
   player.on('ready', function() {
      console.log('player on ready');
    });
    player.on('error', function() {
      console.log('player on error');
    });
</script>

if error event triggered, the player ready listener will no fire, because player all event listener had been remove I know I did not use the contrib-hls. I modify EventedMixin.off function like that: image or modify Player removeTechControlsListeners_ image

versions

videojs

6.2.8

browsers

Chrome

OSes

windows 7 Mac OS X

plugins

no

コントリビューターガイド