Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

https support for NetStream

New Here ,
Jun 21, 2012 Jun 21, 2012

I need to stream a flv video from https web server to flash GUI.

I am using NetConnect, NetStream and Video objects. But when I try to stream the video it gives errors:

'Error opening URL" and "Stream not found".

This problem is not seen if I try to access video from action script if the URL is of a http web server.

I am NOT using flash streaming server or flash media server. I am using Action Script 3.0

The same URL is showing the video file contents if I directly access it from web browser from the same machine.

Can you please let me know if flash video is supported from a https web server? Are there any alternatives or options or properties available to make this work?

Thanks,

Gulshan

TOPICS
ActionScript
2.0K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Contributor ,
Jun 21, 2012 Jun 21, 2012

If you are working on progressive video use Netconnection to null and use Netstream.play("path/yourFile.flv")

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jun 21, 2012 Jun 21, 2012

I have done that. I am using the sample code from:

http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/net/NetStream.html#includeE...

The code is as below:

package {

    import flash.display.Sprite;

    import flash.events.NetStatusEvent;

    import flash.events.SecurityErrorEvent;

    import flash.media.Video;

    import flash.net.NetConnection;

    import flash.net.NetStream;

    import flash.events.Event;

    public class NetConnectionExample extends Sprite {

        //private var videoURL:String = "http://www.helpexamples.com/flash/video/cuepoints.flv";

       private var videoURL:String = "https://<IPadress>/<filename>.flv";

        private var connection:NetConnection;

        private var stream:NetStream;

        private var video:Video = new Video();       

        public function NetConnectionExample() {

            connection = new NetConnection();

            connection.addEventListener(NetStatusEvent.NET_STATUS, netStatusHandler);

            connection.addEventListener(SecurityErrorEvent.SECURITY_ERROR, securityErrorHandler);

            connection.connect(null);

        }

        private function netStatusHandler(event:NetStatusEvent):void {

            switch (event.info.code) {

                case "NetConnection.Connect.Success":

                    connectStream();

                    break;

                case "NetStream.Play.StreamNotFound":

                    trace("Stream not found: " + videoURL);

                    break;

            }

        }

        private function securityErrorHandler(event:SecurityErrorEvent):void {

            trace("securityErrorHandler: " + event);

        }

        private function connectStream():void {

            var stream:NetStream = new NetStream(connection);

            stream.addEventListener(NetStatusEvent.NET_STATUS, netStatusHandler);

            stream.client = new CustomClient();

            video.attachNetStream(stream);

            stream.play(videoURL);

            addChild(video);

        }

    }

}

class CustomClient {

    public function onMetaData(info:Object):void {

        trace("metadata: duration=" + info.duration + " width=" + info.width + " height=" + info.height + " framerate=" + info.framerate);

    }

    public function onCuePoint(info:Object):void {

        trace("cuepoint: time=" + info.time + " name=" + info.name + " type=" + info.type);

    }

}

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Contributor ,
Jun 21, 2012 Jun 21, 2012

so what error you are getting

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jun 21, 2012 Jun 21, 2012

'Error opening URL" and "Stream not found"

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Contributor ,
Jun 21, 2012 Jun 21, 2012

From where you are testing?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jun 21, 2012 Jun 21, 2012
LATEST

I am testing from the machine where I have developed flash UI. The scenario is as below:

M/c 1 fla file ----------> M/c2 SSL web server (https)

In this scenario it fails.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines