I've got a very simple OSMF (1.5) Player. Just a few lines of code. (It's a simplified player, because the problem occured in a comprehensive customer project.)
The Player initially creates a MediaElement from an mp4 File URL provided via RTMP.
After its creation the MediaElement instance is assigned to the MediaPlayer and added to the MediaContainer.
The autoPlay property of the MediaPlayer is set to false.
The mentioned mp4 is provided by a FMS Version 22.214.171.124 which is not (and will not be) under my control.
If you now let the player keep waiting in you browser without doing anything, you will notice, that after ~10 to 15 minutes the player starts playback as if by magic.
Furthermore no OSMF related Event is triggered in conjunction with this phenomenon.
Here's the explanation:
The OSMF Netloader class provides a functionality called stream reconnect.
This feature becomes operative if:
You can take a look at this at the Netloader class:
search for "setupStreamReconnect"
If you initialize the MediaPlayer with autoPlay=false and then wait, after a certain period the FMS closes the netconnection due to missing data through.
In this case the reconnection mechanim receives the "NetConnection.Connect.Closed" event and establishs an alternativ net connection.
If this connection is established, the the stream is transferred from the closed to the new connection and the following line is executed:
And then the player undesirably starts running.
Heres the simple example:
You'll just see an orange background with a grey rectangle.
Keep the browser window open and wait.
Anyone confronted with this problem too?
Maybe ideas for workarounds.
thanx and greetz
BTW: The phenomenon also occurs with OSMF 1.6 and 2.0, because the NetLoader Class hasn't changed in conjunction with this
it is a use case that was not tested on stream reconnect feature.
we're tracking it as http://bugs.adobe.com/jira/browse/FM-1559 .
As a workaround, you could modify the reconnect code to not restart if the time is still zero.
Many thanks for the fast reply.
I've got a follow up question.
What will happen if I modify the reconnect Code in the OSMF Netloader Class as recommended and then load multiple third party OSMF plugins,
which may have included the origin OSMF version of the Netloader class.
Which one will be used at runtime?
Thanks in advance!