Stream switching is not a synchronous operation, as typically the player needs to eat through the existing buffer. The current stream index will remain at its previous value until the switch completes. You should try listening for the switchingChange event. You'll get one when the switch begins (switching == true), and another one when the switch completes (switching == false).
Hi, thanx for your help.
I now I listen to the event, but the switch never finishes...
dynamicStreamTrait = mediaElement.getTrait(MediaTraitType.DYNAMIC_STREAM) as DynamicStreamTrait;
private function onTestChange(evt:DynamicStreamEvent):void
if(evt.switching == true)
trace ('switching starts');
'switching finished' is never traced. what can be wrong? Thanx.
That's almost certainly a bug. We've seen this occur before when the encoded file's bitrate vastly exceeds available bandwidth, and have a bug filed for that case against FMS. But I'm not sure whether you're running into the same thing.
Could you log a bug here?
If you don't want to post your RTMP links publicly, feel free to email them to me directly (briggs at adobe dot com).
Hi, i still couldn't solve the problem. Has anybody got a working sample for switching the streams manually with actual sprite?
Brian told me, that FMS in version 3 doesn't support server-side dynamic stream switching. So hopefully I can upgrade.
Thanks a lot to Brian for your great support.
I get the same problem.
Here is an email that I have send to email@example.com.
Hope to can help you,
Using OSMF2.0 to stream a smil title.
Add the MediaPlayerCapabilityChangeEvent.IS_DYNAMIC_STREAM_CHANGE event listener, after the event dispatch then add the DynamicStreamEvent.SWITCHING_CHANGE event listener.
The bitrate info can be report, normal. But after I add the SMPTE-TT plugin and load it like this:
var pluginResource:MediaResourceBase = new PluginInfoResource(new SMPTETTPluginInfo);mediaFactory.loadPlugin(pluginResource);
The title can be stream correct and the quality of the video can be set by the bandwidth, but only the DynamicStreamEvent.SWITCHING_CHANGE event can not be dispatch, so I can't get the current bitrate info.
I debug it in the OSMF source code and find the issue in the org.osmf.elements.compositeClasses.ParallelDynamicStreamTrait class line 323
onSwitchingChange function that the numChildrenSwitching property always 0, so it can not call the setSwitching function and can not dispatch DynamicStreamEvent.SWITCHING_CHANGE event.
So, I add some changes from line 333 to line 336 and it has be fix: