FLVPlayback 2.5 - Exception thrown when switching from a dynamic stream to a normal stream


for might come accross , use information until following bug fixed.

 

problem

the flvplayback component iterates through list of playlist items, of may progressivly downloaded, streamed on standard rtmp connection, , taking advantage of flash's new adaptive streaming technology. problem whenever play adaptive stream, if update source of flvplayback component rtmp or regular progressive download url, exception thrown because videoplayer assumes still dealing dynamic stream, not.

 

--- exception exerpt ---

typeerror: error #1009: cannot access property or method of null object reference.
    @ fl.video::videoplayer/http://www.adobe.com/2007/flash/flvplayback/internal::_playdynamicstream()[fl\video\videop layer.as:4000]
    @ fl.video::videoplayer/http://www.adobe.com/2007/flash/flvplayback/internal::_play()[fl\video\videoplayer.as:3981 ]
    @ fl.video::videoplayer/http://www.adobe.com/2007/flash/flvplayback/internal::_setupstream()[fl\video\videoplayer. as:4366]
    @ fl.video::videoplayer/http://www.adobe.com/2007/flash/flvplayback/internal::_load()[fl\video\videoplayer.as:1287 ]
    @ fl.video::videoplayer/play()[fl\video\videoplayer.as:1025]
    @ fl.video::flvplayback/docontentpathconnect()[fl\video\flvplayback.as:4790]
    @ fl.video::flvplayback/set source()[fl\video\flvplayback.as:2818]

---

 

further examination of bug shows root of problem lies in function _createstream() inside videoplayer class.

 

--- code block ---

flvplayback_internal function _createstream():void {
            //ifdef debug
            //debugtrace("_createstream()");
            //endif
            _ns = null;
           
            var thens:netstream;
            if(_ncmgr.isdynamicstream == true){
                thens = new dynamicstream(_ncmgr.netconnection);
            } else {
                thens = new netstream(_ncmgr.netconnection);
            }

---

 

the problem here _ncmgr.isdynamicstream returns true once dynamic stream has played, flash creats dynamicstream object subsequent streams. trailing down chain further, see _isdynamicstream set class ncmanagerdynamicstream.as. see _isdynamicstream set true upon successful connection, no in code ever reset false.

 

workaround

to fix this, created new incmanager class , overrided close() function. physically in player, call close method on video player before set source flvplayback component. clears issue.

 

--- code block ---

// new incmanager class. overrides ncmanagerdynamicstream

public class customncmanagerdynamicstream extends ncmanagerdynamicstream implements incmanager
{
    /**
     * workaround flvplayback bug. videoplayer must closed cleanup
     * dynamic stream member.
     */
    public override function close() : void
    {
        super.close();
        _isdynamicstream = false;
    }
}

 

 

// in application, must set source , close video before each new source assigned flvplayback component.

videoplayer.incmanagerclass = "path.to.customncmanagerdynamicstream";

 

// play new source

mplayer.getvideoplayer(0).close();
mplayer.source = mcurrentplaylistitem.mediaurl;

---

 

 

so temp fix, nice if flvplayback component fixed this. or @ least make sure isn't issue in upcomming strobe player.

 

 

cheers.



More discussions in Adobe Animate CC - General


adobe

Comments

Popular posts from this blog

Error compiling for board Arduino/Genuino Uno.

Installation database is corrupt

esp8266 (nodemcu 0.9) client.write très lent ???