Order Now AdSolution Sign Up | Login » Bits on the Run Sign Up | Login »

Forums

/

Error - API Load Method with streamer argument

3 replies [Last post]
Reply

Hello,

I need to call .load method to play rtmp or rtmpe streams. Am I allowed to do the following?

var lio = url.lastIndexOf("/");
var s = url.substring(0, lio);
var f = url.substring(lio + 1);

myJWPlayer.load({
streamer: s,
file: f
});

When I do that, the player gives the following error:

ArgumentError: Error #2126: NetConnection object must be connected.
at flash.net::NetStream/ctor()
at flash.net::NetStream()
at com.longtailvideo.jwplayer.media::RTMPMediaProvider/setStream()
at com.longtailvideo.jwplayer.media::RTMPMediaProvider/play()
at com.longtailvideo.jwplayer.controller::Controller/play()
at com.longtailvideo.jwplayer.player::Player/play()
at com.longtailvideo.jwplayer.player::JavascriptAPI/playToggle()
at com.longtailvideo.jwplayer.player::JavascriptAPI/js_play()
at Function/http://adobe.com/AS3/2006/builtin::apply()
at flash.external::ExternalInterface$/_callIn()
at Function/<anonymous>()
at flash.external::ExternalInterface$/_evalJS()
at flash.external::ExternalInterface$/call()

thanks in advance

Reply

seems u try to play a video when netStream is not connected to the stream server.

Here is some code that may be of help for you when troubleshooting
netStream

function netStatusHandler(event:NetStatusEvent):void {
    // handles net status events
    switch (event.info.code) {
        case "NetConnection.Connect.Success":
        // DO HERE YOUR CALL TO PLAY THE FILE
        break;
        // trace a messeage when the stream is not found
        case "NetStream.Play.StreamNotFound":
            trace("Stream not found: " + strSource);
        break;
        // when the video reaches its end, we check if there are
        // more video left or stop the player
        case "NetStream.Play.Stop":
            if(intActiveVid + 1 < xmlPlaylist..vid.length())
                playNext();
            else
                stopVideoPlayer();
        break;
    }
}

hope this is helpful to you

Reply

Do you mean that I should change JwPlayer source code to support this feature?

Any of you was able to load a stream with streamer and file parameters?

Reply

hello,

I found out that the problem was how the JWPlayer was connecting to the video server.

This server has a custom plugin for a CDN that requires to use the NetStream.connect method with extra parameters.

I changed the source code and it worked fine. The video played but the error kept showing.

cheers

Post new comment

  • Allowed HTML tags: <code> <blockquote> <em> <strong> <strike> <ul> <li> <ol>
  • You may post code using <code>...</code> .
  • Lines and paragraphs break automatically.
  • Web page addresses and e-mail addresses turn into links automatically.

More information about formatting options