diff --git a/package.json b/package.json index 72d765423b..0481716ac7 100644 --- a/package.json +++ b/package.json @@ -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" }, diff --git a/src/js/player.js b/src/js/player.js index 245354bef0..ed1e01380d 100644 --- a/src/js/player.js +++ b/src/js/player.js @@ -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 * diff --git a/src/js/tech/flash.js b/src/js/tech/flash.js index 11bb2ceffd..5c9a8b524a 100644 --- a/src/js/tech/flash.js +++ b/src/js/tech/flash.js @@ -457,7 +457,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