Skip to main content
Participant
March 26, 2010
Question

Livestream works with "livetest" only

  • March 26, 2010
  • 1 reply
  • 913 views

Hi everyone. I have a rather strange problem I need some help with.

I can get my livestream working with the livetest application included in my FMS v3.0 application folder.

When I try to connect to the livestream using any other flashplayer with the right settings, it simply wont work.

I am currently using FLME 3 and FMS 3. Both are run on the same machine, hence connecting to "rtmp://localhost/live/livestream" as per default.

The stream works flawlessly with the livetest swf, even tried with an external connection outside my LAN.

Using Windows 7.

I tried creating a new flashplayer in Flash CS4 and got the following error message when starting the .swf-file:

SecurityError: Error #2028: The SWF-file Untitled-1.swf in the local filesysten cannot access the internet-URL rtmp://localhost/live/livestream.
    at flash.net::NetConnection/connect()
    at fl.video::NCManager/http://www.adobe.com/2007/flash/flvplayback/internal::nextConnect()
    at fl.video::NCManager/http://www.adobe.com/2007/flash/flvplayback/internal::connectRTMP()
    at fl.video::NCManager/connectToURL()
    at fl.video::VideoPlayer/http://www.adobe.com/2007/flash/flvplayback/internal::_load()
    at fl.video::VideoPlayer/load()
    at fl.video::FLVPlayback/doContentPathConnect()

Any help in this matter would be greatly appriciated. Thanks in advance.

    This topic has been closed for replies.

    1 reply

    Participating Frequently
    March 26, 2010

    First of all are you trying directly from Authoring or are you trying to save the Untitled.swf and then trying to connect.

    If its latter case, can you check your Flash Player Security Settings:

             I think you might be running into Flash Security Issue. Do following steps:

              Open your client .swf or .html in Flash Player(or your browser) from another computer. Right click on .swf , it should give you pop up menu with      options like Settings and Global Settings. Click on Global Settings. It will take you to page on web      :http://www.macromedia.com/support/documentation/en/flashplayer/help/settings_man ager.html. You will few links :- Click on What are security      settings?. Then click onGlobal Security Settings panel link which would be there on the page.

         It will show up Dialog box: Do following steps

         Click on Always Allow and then click on Edit Locations drop down. Click on Add Location. Browse for your client file(untitled.swf in your case) or  add      the folder where you have your client .swf or .html or you can add whole drive for now say C:\.

         Now close the page.

         Close the .swf (untitled.swf in your case)or .html file which you are using as client.

         Open it back now and try now.

    Now if its former case,if you are trying directly in Authoring, ideally you should not get into Flash Player Security issue. If this is case, can you paste the code you are using to connect to live application.

    Oxygen125Author
    Participant
    March 26, 2010

    This is the actionscript code I am using, this is from a prewritten player, not made by me.

    I am sure you will find what you need somewhere here, I am not good at coding.

    class player extends MovieClip {
        var video_playback:Video;
        var net_nc:NetConnection;
        var net_ns:NetStream;
        var sound:Sound;
        //variables
        var playStatus = false;
        var videoBytesLoaded;
        var videoBytesTotal;
        var videoTotalTime;
        var videoTimePlayed;
        var videoTotalTimeText;
        var videoTimePlayedText;
        var playState = true;
        var FLVuration;
        var file;
        var playComplete = false;
        static var FLVduration;
        static var replay = false;
        var vol = 50;
        //
        var bg_mc:MovieClip;
        var snd:MovieClip;
        static var conn;
        static var con = "Connecting";
        var cont;
        var connect = false;
        //
        //
        function player() {
            net_nc = new NetConnection();
            net_nc.connect("rtmp://localhost/live/livestream"); // <--- This one is right
            net_ns = new NetStream(net_nc);
            video_playback.smoothing = true;
            video_playback.attachVideo(net_ns);
            net_ns.setBufferTime(1);
            snd.attachAudio(net_ns);
            sound = new Sound(snd);
            sound.setVolume(vol);
            statusnet();
        }
        function onEnterFrame() {
            videoBytesTotal = net_ns.bytesTotal;
            videoBytesLoaded = net_ns.bytesLoaded;
            videoTimePlayed = net_ns.time;
            videoTotalTime = FLVduration;
            playComplete = replay;
            connect = conn;
            //
            var minutes2:Number = Math.floor(videoTimePlayed/60);
            var seconds2 = Math.floor(videoTimePlayed%60);
            if (seconds2<10) {
                seconds2 = "0"+seconds2;
            }
            videoTimePlayedText = minutes2+":"+seconds2;
            //
            var minutes = Math.floor(videoTotalTime/60);
            var seconds = Math.floor(videoTotalTime%60);
            if (isNaN(minutes)) {
                minutes = 0;
                seconds = 0;
            }
            if (seconds<10) {
                seconds = "0"+seconds;
            }
            videoTotalTimeText = minutes+":"+seconds;
            //
            if (replay) {
                playStatus = false;
                net_ns.seek(0);
                pauseVideo();
                bg_mc._visible = true;
            }
            cont = con;
            //trace(videoTotalTime);                 
        }
        function statusnet() {
            net_nc.onStatus = function(info) {
                if (info.code == "NetConnection.Connect.Success") {
                    //connect_mc.gotoAndStop(2);
                    conn = true;
                    con = "Server Connection success";
                }
                if (info.code == "NetConnection.Connect.Rejected") {
                    con = "Server Connection Closed..Please refresh page";
                    replay = true;
                    conn = false;
                }
                if (info.code == "NetConnection.Connect.Closed") {
                    con = "Server Connection Closed..Please refresh page";
                    replay = true;
                    conn = false;
                }
                trace(info.code);
            };
            net_ns.onStatus = function(infoObject:Object) {
                trace(infoObject.code);
                //con = infoObject.code;
                if (infoObject.code == "NetStream.Seek.Notify") {
                    playStatus = true;
                    /*bg_mc._visible = false;*/
                }
                if (infoObject.code == "NetStream.Play.InsufficientBW") {
                    con = "Poor Bandwidth";
                    net_ns.setBufferTime(1);
                }
                if (infoObject.code == "NetStream.Play.Start") {
                    con = "Playing";
                }
                if (infoObject.code == "NetStream.Buffer.Full") {
                    con = "Stream Playing";
                    net_ns.setBufferTime(2);
                }
                if (infoObject.code == "NetStream.Buffer.Empty") {
                    con = "Buffering";
                    net_ns.setBufferTime(1);
                }
                if (infoObject.code == "NetStream.Play.Failed") {
                    con = "Stream Connection failed";
                }

            };
            net_ns.onMetaData = function(infoObject:Object) {
                FLVduration = infoObject["duration"];
            };
        }
        function playVideo() {
            bg_mc._visible = false;
            replay = false;
            if (playState) {
                net_ns.play("livestream");  // <--- This one is right
                playState = false;
            }
            net_ns.pause(false);
            playStatus = true;
        }
        function pauseVideo() {
            net_ns.pause(true);
            playStatus = false;
        }
        function seekVideo(val:Number) {
            if (val<=videoTotalTime) {
                net_ns.seek(val);
            }
        }
        function setSound(val) {

            if (val>100) {
                val = 100;
            }
            vol = val;
            sound.setVolume(vol);
        }
    }

    I have no idea why I get the security error on this one, its a livestream and should have no problem displaying this stream.

    Participating Frequently
    March 26, 2010

    net_nc.connect("rtmp://localhost/live/livestream"); // <--- This one is right

        I think this should be net_nc.connect("rtmp://localhost/live");

    I have no idea why I get the security error on this one, its a livestream and should have no problem displaying this stream.

    Did you try the Flash Player Security thing which i told you?