1
0
mirror of https://github.com/videojs/video.js.git synced 2024-11-24 08:42:25 +02:00

@alex-phillips added ontextdata to Flash tech. closes #2748

This commit is contained in:
alex-phillips 2016-07-18 14:16:58 -04:00 committed by Gary Katsevman
parent f36da276e3
commit e7ca49e668
4 changed files with 19 additions and 2 deletions

View File

@ -16,6 +16,7 @@ CHANGELOG
* @ldayananda updated videojs to not do anything if no src is set ([view](https://github.com/videojs/video.js/pull/3378))
* @nickygerritsen removed unused tracks when changing sources. Fixes #3000 ([view](https://github.com/videojs/video.js/pull/3002))
* @vit-koumar updated Flash tech to return Infinity from duration instead of -1 ([view](https://github.com/videojs/video.js/pull/3128))
* @alex-phillips added ontextdata to Flash tech ([view](https://github.com/videojs/video.js/pull/2748))
--------------------

View File

@ -30,7 +30,7 @@
"tsml": "1.0.1",
"videojs-font": "2.0.0",
"videojs-ie8": "1.1.2",
"videojs-swf": "5.0.1",
"videojs-swf": "5.1.0",
"videojs-vtt.js": "0.12.1",
"xhr": "2.2.0"
},

View File

@ -624,6 +624,7 @@ class Player extends Component {
this.on(this.tech_, 'texttrackchange', this.handleTechTextTrackChange_);
this.on(this.tech_, 'loadedmetadata', this.updateStyleEl_);
this.on(this.tech_, 'posterchange', this.handleTechPosterChange_);
this.on(this.tech_, 'textdata', this.handleTechTextData_);
this.usingNativeControls(this.techGet_('controls'));
@ -1160,6 +1161,14 @@ class Player extends Component {
this.trigger('loadedmetadata');
}
handleTechTextData_() {
var data = null;
if (arguments.length > 1) {
data = arguments[1];
}
this.trigger('textdata', data);
}
/**
* Fires when the browser has loaded the current frame of the audio/video
*
@ -2876,6 +2885,13 @@ Player.prototype.handleTechLoadStart_;
*/
Player.prototype.handleLoadedMetaData_;
/**
* Fired when the player receives text data
*
* @event textdata
*/
Player.prototype.handleTextData_;
/**
* Fired when the player has downloaded data at the current playback position
*

View File

@ -471,7 +471,7 @@ Flash.checkReady = function(tech){
// Trigger events from the swf on the player
Flash.onEvent = function(swfID, eventName){
let tech = Dom.getEl(swfID).tech;
tech.trigger(eventName);
tech.trigger(eventName, Array.prototype.slice.call(arguments, 2));
};
// Log errors from the swf