xgplayer-flv.js
Advanced tools
Comparing version 2.0.2 to 2.1.0-beta.0
{ | ||
"name": "xgplayer-flv.js", | ||
"version": "2.0.2", | ||
"version": "2.1.0-beta.0", | ||
"description": "web video player", | ||
@@ -5,0 +5,0 @@ "main": "./dist/index.js", |
@@ -65,2 +65,3 @@ /* | ||
ctl.on(TransmuxingEvents.RECOMMEND_SEEKPOINT, this._onRecommendSeekpoint.bind(this)); | ||
ctl.on(TransmuxingEvents.LOADED_SEI, this._onLoadedSei.bind(this)); | ||
} | ||
@@ -192,2 +193,8 @@ } | ||
_onLoadedSei(timestamp,data) { | ||
Promise.resolve().then(() => { | ||
this._emitter.emit(TransmuxingEvents.LOADED_SEI, timestamp, data); | ||
}); | ||
} | ||
_onLoggingConfigChanged(config) { | ||
@@ -194,0 +201,0 @@ if (this._worker) { |
@@ -269,2 +269,4 @@ /* | ||
this._demuxer.onLoadedSei = this._onLoadedSei.bind(this); | ||
this._remuxer.bindDataSource(this._demuxer | ||
@@ -318,2 +320,6 @@ .bindDataSource(this._ioctl | ||
_onLoadedSei(timestamp, data) { | ||
this._emitter.emit(TransmuxingEvents.LOADED_SEI,timestamp,data); | ||
} | ||
_onIOSeeked() { | ||
@@ -320,0 +326,0 @@ this._remuxer.insertDiscontinuity(); |
@@ -28,5 +28,6 @@ /* | ||
STATISTICS_INFO: 'statistics_info', | ||
RECOMMEND_SEEKPOINT: 'recommend_seekpoint' | ||
RECOMMEND_SEEKPOINT: 'recommend_seekpoint', | ||
LOADED_SEI: 'loaded_sei' | ||
}; | ||
export default TransmuxingEvents; |
@@ -113,2 +113,4 @@ /* | ||
})(); | ||
this._onLoadedSei = null; | ||
} | ||
@@ -231,2 +233,10 @@ | ||
set onLoadedSei(callback) { | ||
this._onLoadedSei = callback; | ||
} | ||
get onLoadedSei() { | ||
return this._onLoadedSei; | ||
} | ||
resetMediaInfo() { | ||
@@ -1047,2 +1057,7 @@ this._mediaInfo = new MediaInfo(); | ||
let unit = {type: unitType, data: data}; | ||
if (unitType === 6) { // SEI TODO: change to 6 | ||
this._onLoadedSei && this._onLoadedSei(tagTimestamp, data); | ||
} | ||
units.push(unit); | ||
@@ -1049,0 +1064,0 @@ length += data.byteLength; |
@@ -256,2 +256,6 @@ /* | ||
this._transmuxer.on(TransmuxingEvents.LOADED_SEI, (timestamp, data) => { | ||
this._emitter.emit(PlayerEvents.LOADED_SEI, timestamp, data); | ||
}); | ||
this._transmuxer.open(); | ||
@@ -258,0 +262,0 @@ } |
@@ -24,5 +24,6 @@ /* | ||
MEDIA_INFO: 'media_info', | ||
STATISTICS_INFO: 'statistics_info' | ||
STATISTICS_INFO: 'statistics_info', | ||
LOADED_SEI: 'loaded_sei' | ||
}; | ||
export default PlayerEvents; |
@@ -52,6 +52,16 @@ import Player from 'xgplayer' | ||
flv.play() | ||
flv.on(Flv.Events.ERROR, (e) => { | ||
player.emit('error', new Player.Errors('other', player.config.url)) | ||
}) | ||
flv.on(Flv.Events.LOADED_SEI, (timestamp, data) => { | ||
player.emit('loaded_sei', timestamp, data); | ||
}) | ||
flv.on(Flv.Events.STATISTICS_INFO, (data) => { | ||
player.emit("statistics_info",data); | ||
}) | ||
flv.on(Flv.Events.MEDIA_INFO, (data)=>{ | ||
player.mediainfo = data; | ||
player.emit("MEDIA_INFO",data); | ||
}) | ||
player.once('destroy', () => { | ||
@@ -58,0 +68,0 @@ flv.destroy() |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
658519
8334
3