Wowza Community

Flash Builder 4 and Live Streaming Help

Has anyone successfully streamed a Live feed from Wowza on AmazonEC2 (or Wowza 2) using either the VideoPlayer or VideoDisplay Components in Flash Builder 4?

I cannot get the spark VideoPlayer or VideoDisplay component to play a Live stream from Wowza.

They stream a recorded file, without problem.

I know my serverside application is working, because I CAN playback the exact same live feed using the example client LiveStreamingVideo application.

i’ve tried setting the source as a URL;

<s:VideoPlayer x="331" y="74" source="rtmp://ec2-123456789.compute-1.amazonaws.com/uxlivefeeder/live666/liveFeed" autoPlay="true" />

i’ve tried setting the source, using the DynamicStreamingVideoSource and DynamicStreamingVideoItem Objects:

<?xml version="1.0" encoding="utf-8"?>
<s:Application xmlns:fx="http://ns.adobe.com/mxml/2009" 
			   xmlns:s="library://ns.adobe.com/flex/spark" 
			   xmlns:mx="library://ns.adobe.com/flex/mx" minWidth="955" minHeight="600">
	<fx:Script>
		<![CDATA[
			import org.osmf.events.MediaPlayerStateChangeEvent;
			protected function videoplayer1_mediaPlayerStateChangeHandler(event:MediaPlayerStateChangeEvent):void
			{
				// TODO Auto-generated method stub
				trace("event:MediaPlayerStateChangeEvent -" + event.state);
			}
		]]>
	</fx:Script>
	<fx:Declarations>
		<!-- Place non-visual elements (e.g., services, value objects) here -->
		<s:DynamicStreamingVideoSource id="lfeed" host="rtmp://ec2-123456789.compute-1.amazonaws.com/uxlivefeeder/live666/" streamType="live" >
			<s:DynamicStreamingVideoItem streamName="liveFeed.flv" />
		</s:DynamicStreamingVideoSource>
	</fx:Declarations>
	<s:VideoPlayer x="21" y="28" id="vplayer" source="lfeed" autoPlay="true"  mediaPlayerStateChange="videoplayer1_mediaPlayerStateChangeHandler(event)">
	</s:VideoPlayer>
		
</s:Application>

tracing out the MediaPlayerStateChangeEvent i get the following:

event:MediaPlayerStateChangeEvent -loading

event:MediaPlayerStateChangeEvent -ready

event:MediaPlayerStateChangeEvent -playing

event:MediaPlayerStateChangeEvent -playbackError

Do I have to change my wowza applications, in order to play live video using Flex4 / Flash Builder 4 components?

thanks,

drewbe

I had to get Flash Builder re-installed to dig into this, since my trial version expired.

I was hoping to suggest taking the “.flv” extension off the item name, but it didn’t work for me. I don’t even see it trying to connect to Wowza.

I’ll look into it some more…

Richard

I think what happens if you just set the source to a url is that it assumes it is a vod file and trys to play it as such. You need to tell it that it is a live video and with the current version the way that Richard has outlined is probably the easiest way.

Saying that, Adobe in their wisdom have decided to release the sdk 4 with Flash Builder with an old beta version of osmf which is what the video player component is built on. The current version of osmf is completely different and the video player doesnt even compile with it. Hopefully the next version of the SDK will sort it out.

Not sure why, but it worked like this instead:

<?xml version="1.0" encoding="utf-8"?>
<s:Application xmlns:fx="http://ns.adobe.com/mxml/2009" 
			   xmlns:s="library://ns.adobe.com/flex/spark" 
			   xmlns:mx="library://ns.adobe.com/flex/mx" minWidth="955" minHeight="600">
	<fx:Script>
		<![CDATA[
			import org.osmf.events.MediaPlayerStateChangeEvent;
			
			protected function videoplayer1_mediaPlayerStateChangeHandler(event:MediaPlayerStateChangeEvent):void
			{
				// TODO Auto-generated method stub
				trace("event:MediaPlayerStateChangeEvent -" + event.state);
			}
			
		]]>
	</fx:Script>
	<fx:Declarations>
		<!-- Place non-visual elements (e.g., services, value objects) here -->
		
	</fx:Declarations>
	<s:VideoPlayer x="21" y="28" id="vplayer" autoPlay="true"  mediaPlayerStateChange="videoplayer1_mediaPlayerStateChangeHandler(event)">
		<s:source>
			<s:DynamicStreamingVideoSource id="lfeed" host="rtmp://localhost/live/_definst_" streamType="live" >
				<s:DynamicStreamingVideoItem streamName="test" />
			</s:DynamicStreamingVideoSource>
		</s:source>
	</s:VideoPlayer>
	
</s:Application>

Richard

i tried that as well but it just won’t work… for me…

but since you got it to work, i can at least continue trying in the comfort that it’s possible… and not some bug or special setting…

thanks, as always for your quick and helpful responses

drew

I had to use the mx version of VideoDisplay, and it worked.

I think my problem might be I’m somehow referencing an old MediaPlayer.swc.

thanks