this.removeButton = function(id) {
            const customButtons = _.filter(
                _model.get('customButtons'),
                (button) => button.id !== id
            );

            _model.set('customButtons', customButtons);
        };
function _clearSideloadedTextTracks() {
    // Clear VTT textTracks
    if (!this._textTracks) {
        return;
    }
    var nonSideloadedTracks = _.filter(this._textTracks, function (track) {
        return track.embedded || track.groupid === 'subs';
    });
    this._initTextTracks();
    _.each(nonSideloadedTracks, function (track) {
        this._tracksById[track._id] = track;
    });
    this._textTracks = nonSideloadedTracks;
}
function textTrackChangeHandler() {
    var textTracks = this.video.textTracks;
    var inUseTracks = _.filter(textTracks, function (track) {
        return (track.inuse || !track._id) && _kindSupported(track.kind);
    });
    if (!this._textTracks || _tracksModified.call(this, inUseTracks)) {
        this.setTextTracks(textTracks);
        return;
    }
    // If a caption/subtitle track is showing, find its index
    var selectedTextTrackIndex = -1;
    for (var i = 0; i < this._textTracks.length; i++) {
        if (this._textTracks[i].mode === 'showing') {
            selectedTextTrackIndex = i;
            break;
        }
    }

    // Notifying the model when the index changes keeps the current index in sync in iOS Fullscreen mode
    if (selectedTextTrackIndex !== this._currentTextTrackIndex) {
        this.setSubtitlesTrack(selectedTextTrackIndex + 1);
    }
}
Beispiel #4
0
 this.getCurrentCues = function (allCues, pos) {
     return filter(allCues, function (cue) {
         return pos >= (cue.startTime) && (!cue.endTime || pos <= cue.endTime);
     });
 };