Skip to content

Commit a0165b4

Browse files
author
Germano Fronza
committed
Levels were reports on every state change
1 parent 0f6de59 commit a0165b4

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

src/RTMP.as

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,7 @@ package {
139139
}
140140

141141
private function onLoaded(event:LoadEvent):void {
142+
_triggerEvent("onloaded")
142143
netStream = netStreamLoadTrait.netStream;
143144
netStream.addEventListener(NetStatusEvent.NET_STATUS, netStatusHandler);
144145
mediaPlayer.play();

src/main.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,7 @@ export default class RTMP extends Flash {
8686
Mediator.on(this.uniqueId + ':progress', this.progress, this)
8787
Mediator.on(this.uniqueId + ':timeupdate', this.updateTime, this)
8888
Mediator.on(this.uniqueId + ':statechanged', this.checkState, this)
89+
Mediator.on(this.uniqueId + ':onloaded', this.reporLevels, this)
8990
Mediator.on(this.uniqueId + ':levelChanging', this.levelChanging, this)
9091
Mediator.on(this.uniqueId + ':levelChanged', this.levelChange, this)
9192
Mediator.on(this.uniqueId + ':flashready', this.bootstrap, this)
@@ -168,7 +169,9 @@ export default class RTMP extends Flash {
168169

169170
this.isReady = true
170171
this.trigger(Events.PLAYBACK_READY, this.name)
172+
}
171173

174+
reporLevels() {
172175
if (this.isDynamicStream) {
173176
if (this.levels) {
174177
this.trigger(Events.PLAYBACK_LEVELS_AVAILABLE, this.levels, this.options.rtmpConfig.startLevel)

0 commit comments

Comments
 (0)