0

I am passing hard coded value rtmp url & stream name for live streaming in VideoDisplay component of flash player. it is working good and i can able to display video streaming on HTML page.

<s:VideoDisplay width="100%" height="100%" autoPlay="true" >
            <s:source>
                <s:DynamicStreamingVideoSource host="rtmp://X.X.X.X/live" streamType="live" >
                    <s:DynamicStreamingVideoItem streamName="rtmpStream"/>
                </s:DynamicStreamingVideoSource>
            </s:source>
</s:VideoDisplay>

But when i have pass parameter from HTML page it would not working. It is also not given any error but not able to view live video stream on HTML page.

    [Bindable]
    public var rtmpUrl:String;

    [Bindable]
    public var rtmpstreamName:String;


    /* Assign values to new properties. */
    private function initVars():void {
        rtmpUrl = FlexGlobals.topLevelApplication.parameters.rtmpUrl;
        rtmpstreamName = FlexGlobals.topLevelApplication.parameters.rtmpstreamName;

        Security.allowDomain("X.X.X.X");
    }

rtmpUrl pass live streaming source and live stream name in rtmpstreamName which passed in to video display component.

<s:VideoDisplay width="100%" height="100%" autoPlay="true" >
        <s:source>
            <s:DynamicStreamingVideoSource host="{rtmpUrl}" streamType="live" >
                <s:DynamicStreamingVideoItem streamName="{rtmpstreamName}"/>
            </s:DynamicStreamingVideoSource>
        </s:source>
</s:VideoDisplay>

HTML Embed Code:

var flashvars = {};
            flashvars.rtmpstreamName = "streamName";
            flashvars.rtmpUrl = "rtmp://X.X.X.X/live"; 

swfobject.embedSWF(
                "deepdemo.swf", "flashContent", 
                "320", "240", 
                swfVersionStr, xiSwfUrlStr, 
                flashvars, params, attributes);
ketan
  • 19,129
  • 42
  • 60
  • 98
Dipak D Desai
  • 867
  • 1
  • 8
  • 20

1 Answers1

0

I think you have forgotten the loaderInfo parameter (see Application's documentation), so the initVars() function become :

 /* Assign values to new properties. */
 private function initVars():void {
        rtmpUrl = FlexGlobals.topLevelApplication.loaderInfo.parameters.rtmpUrl;
        rtmpstreamName = FlexGlobals.topLevelApplication.loaderInfo.parameters.rtmpstreamName;

        Security.allowDomain("X.X.X.X");
 }

If you don't have access to loaderInfo load this function on applicationComplete.

thomas
  • 526
  • 3
  • 10