<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Viewing an FLV video&#8217;s metadata using a Flex VideoDisplay control</title>
	<atom:link href="http://blog.flexexamples.com/2007/09/15/viewing-an-flv-videos-metadata-using-a-flex-videodisplay-control/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.flexexamples.com/2007/09/15/viewing-an-flv-videos-metadata-using-a-flex-videodisplay-control/</link>
	<description>Just a bunch of Adobe Flex Examples</description>
	<lastBuildDate>Thu, 18 Mar 2010 07:46:32 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: paul</title>
		<link>http://blog.flexexamples.com/2007/09/15/viewing-an-flv-videos-metadata-using-a-flex-videodisplay-control/comment-page-1/#comment-1104</link>
		<dc:creator>paul</dc:creator>
		<pubDate>Fri, 08 May 2009 10:20:09 +0000</pubDate>
		<guid isPermaLink="false">http://blog.flexexamples.com/2007/09/15/viewing-an-flv-videos-metadata-using-a-flex-videodisplay-control/#comment-1104</guid>
		<description>Once again, you made my day. Thanks for the FLV metadata tip. :)</description>
		<content:encoded><![CDATA[<p>Once again, you made my day. Thanks for the FLV metadata tip. :)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Alvi</title>
		<link>http://blog.flexexamples.com/2007/09/15/viewing-an-flv-videos-metadata-using-a-flex-videodisplay-control/comment-page-1/#comment-1103</link>
		<dc:creator>Alvi</dc:creator>
		<pubDate>Thu, 09 Apr 2009 11:40:17 +0000</pubDate>
		<guid isPermaLink="false">http://blog.flexexamples.com/2007/09/15/viewing-an-flv-videos-metadata-using-a-flex-videodisplay-control/#comment-1103</guid>
		<description>hellow i am alvi,
this is nice blog i ever visit. keep it more up. thanks</description>
		<content:encoded><![CDATA[<p>hellow i am alvi,<br />
this is nice blog i ever visit. keep it more up. thanks</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Tom</title>
		<link>http://blog.flexexamples.com/2007/09/15/viewing-an-flv-videos-metadata-using-a-flex-videodisplay-control/comment-page-1/#comment-1102</link>
		<dc:creator>Tom</dc:creator>
		<pubDate>Sun, 03 Feb 2008 11:19:16 +0000</pubDate>
		<guid isPermaLink="false">http://blog.flexexamples.com/2007/09/15/viewing-an-flv-videos-metadata-using-a-flex-videodisplay-control/#comment-1102</guid>
		<description>Oups!! I am sorry for my last couple of comments, actually I set autoPlay to false and now metadatareceived is dispatched for my 2 videos ;-)</description>
		<content:encoded><![CDATA[<p>Oups!! I am sorry for my last couple of comments, actually I set autoPlay to false and now metadatareceived is dispatched for my 2 videos ;-)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Tom</title>
		<link>http://blog.flexexamples.com/2007/09/15/viewing-an-flv-videos-metadata-using-a-flex-videodisplay-control/comment-page-1/#comment-1101</link>
		<dc:creator>Tom</dc:creator>
		<pubDate>Sun, 03 Feb 2008 11:09:29 +0000</pubDate>
		<guid isPermaLink="false">http://blog.flexexamples.com/2007/09/15/viewing-an-flv-videos-metadata-using-a-flex-videodisplay-control/#comment-1101</guid>
		<description>Very strange ... seem to be a bug! Instead of metadatareceived event I use this code:

&lt;code&gt;
private function handlerMetadataReceived (event:Event):void {

	if (video.metadata != null) {
		trace (&quot;Meta received! &quot;   video.totalTime   &quot;\n&quot;);

		this.removeEventListener(Event.ENTER_FRAME,handlerMetadataReceived);
	}
}
&lt;/code&gt;

And when I load a new source of video:

&lt;code&gt;
video.source = this.getVideoUrl(value.video,0,this._sessionID, this._userBP);
video.load();
this.addEventListener(Event.ENTER_FRAME, handlerMetadataReceived);
&lt;/code&gt;

Video is a VideoDisplay object. Works good for me, Is anyone could try to show 2 videos sequentially and load metadata?</description>
		<content:encoded><![CDATA[<p>Very strange &#8230; seem to be a bug! Instead of metadatareceived event I use this code:</p>
<p><code><br />
private function handlerMetadataReceived (event:Event):void {</p>
<p>	if (video.metadata != null) {<br />
		trace ("Meta received! "   video.totalTime   "\n");</p>
<p>		this.removeEventListener(Event.ENTER_FRAME,handlerMetadataReceived);<br />
	}<br />
}<br />
</code></p>
<p>And when I load a new source of video:</p>
<p><code><br />
video.source = this.getVideoUrl(value.video,0,this._sessionID, this._userBP);<br />
video.load();<br />
this.addEventListener(Event.ENTER_FRAME, handlerMetadataReceived);<br />
</code></p>
<p>Video is a VideoDisplay object. Works good for me, Is anyone could try to show 2 videos sequentially and load metadata?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Tom</title>
		<link>http://blog.flexexamples.com/2007/09/15/viewing-an-flv-videos-metadata-using-a-flex-videodisplay-control/comment-page-1/#comment-1100</link>
		<dc:creator>Tom</dc:creator>
		<pubDate>Sun, 03 Feb 2008 10:56:02 +0000</pubDate>
		<guid isPermaLink="false">http://blog.flexexamples.com/2007/09/15/viewing-an-flv-videos-metadata-using-a-flex-videodisplay-control/#comment-1100</guid>
		<description>Peter,

I have a question about metadatareceived event: I load 2 videos sequentially, and before that I add an event listener at my video control: video.addEventListener(MetadataEvent.METADATA_RECEIVED, handlerMetadataReceived);, then I load the first video, ok handler is called, but when I load the second, handler is never called!!!

Maybe handler needs to be added twice??

Best,
Tom</description>
		<content:encoded><![CDATA[<p>Peter,</p>
<p>I have a question about metadatareceived event: I load 2 videos sequentially, and before that I add an event listener at my video control: video.addEventListener(MetadataEvent.METADATA_RECEIVED, handlerMetadataReceived);, then I load the first video, ok handler is called, but when I load the second, handler is never called!!!</p>
<p>Maybe handler needs to be added twice??</p>
<p>Best,<br />
Tom</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: peterd</title>
		<link>http://blog.flexexamples.com/2007/09/15/viewing-an-flv-videos-metadata-using-a-flex-videodisplay-control/comment-page-1/#comment-1099</link>
		<dc:creator>peterd</dc:creator>
		<pubDate>Sat, 02 Feb 2008 20:24:39 +0000</pubDate>
		<guid isPermaLink="false">http://blog.flexexamples.com/2007/09/15/viewing-an-flv-videos-metadata-using-a-flex-videodisplay-control/#comment-1099</guid>
		<description>Tom,

Yeah, I&#039;m not sure how many fixes get back-ported to the Flex 201 framework. I don&#039;t suspect too many (we&#039;re more focused on Flex 3 at the moment, naturally).
As for VideoDisplay.smoothing, I know it has been mentioned/requested before. You may want to search the public Flex bug base at http://bugs.adobe.com/flex/ and file a bug report/feature request if there isn&#039;t one already.

In fact, now is a great time to file any bugs/enhancement requests you may have. With Flex 3 development slowing down, Flex 4 planning is starting.

Regards,
Peter</description>
		<content:encoded><![CDATA[<p>Tom,</p>
<p>Yeah, I&#8217;m not sure how many fixes get back-ported to the Flex 201 framework. I don&#8217;t suspect too many (we&#8217;re more focused on Flex 3 at the moment, naturally).<br />
As for VideoDisplay.smoothing, I know it has been mentioned/requested before. You may want to search the public Flex bug base at <a href="http://bugs.adobe.com/flex/" rel="nofollow">http://bugs.adobe.com/flex/</a> and file a bug report/feature request if there isn&#8217;t one already.</p>
<p>In fact, now is a great time to file any bugs/enhancement requests you may have. With Flex 3 development slowing down, Flex 4 planning is starting.</p>
<p>Regards,<br />
Peter</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Tom</title>
		<link>http://blog.flexexamples.com/2007/09/15/viewing-an-flv-videos-metadata-using-a-flex-videodisplay-control/comment-page-1/#comment-1098</link>
		<dc:creator>Tom</dc:creator>
		<pubDate>Sat, 02 Feb 2008 20:06:09 +0000</pubDate>
		<guid isPermaLink="false">http://blog.flexexamples.com/2007/09/15/viewing-an-flv-videos-metadata-using-a-flex-videodisplay-control/#comment-1098</guid>
		<description>Hi! Many thanks to you, that it&#039;s exactly what I am looking for since some days, before I looped until I have video.metadata != null in a ENTER_FRAME event handler ;-( very dirty !!! Strange that Adobe did not integrate it since Flex 2.0, like for smoothing property which is not available for VideoDisplay and Image controls (yes I know that can be fixed with mx_internal ...) but why Adobe doesn&#039;t make them available ???</description>
		<content:encoded><![CDATA[<p>Hi! Many thanks to you, that it&#8217;s exactly what I am looking for since some days, before I looped until I have video.metadata != null in a ENTER_FRAME event handler ;-( very dirty !!! Strange that Adobe did not integrate it since Flex 2.0, like for smoothing property which is not available for VideoDisplay and Image controls (yes I know that can be fixed with mx_internal &#8230;) but why Adobe doesn&#8217;t make them available ???</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Muzak</title>
		<link>http://blog.flexexamples.com/2007/09/15/viewing-an-flv-videos-metadata-using-a-flex-videodisplay-control/comment-page-1/#comment-1097</link>
		<dc:creator>Muzak</dc:creator>
		<pubDate>Tue, 11 Dec 2007 13:53:43 +0000</pubDate>
		<guid isPermaLink="false">http://blog.flexexamples.com/2007/09/15/viewing-an-flv-videos-metadata-using-a-flex-videodisplay-control/#comment-1097</guid>
		<description>If you&#039;re using Flex 2, don&#039;t define the metadataReceived event in mxml, define it through ActionScript instead.
The VideoDisplay class is missing the Event tag
    [Event(name=&quot;metadataReceived&quot;)]
So when defining metadataReceived through mxml you&#039;ll get an error that no such method exists, allthough it is being dispatched. Adding it through ActionScript in a Script block works fine:

    myVideo.addEventListener(&quot;metadataReceived&quot;, metadataReceivedHandler);

I&#039;m also not clear on why you use an Array to store the metadata data. I&#039;d use an Object instead and also not exclude nested Array and Object data. For instance, when using Burak&#039;s metadata injector, data is added with keyframe timestamps that can be used to stream video through PHP or Coldfusion:
http://www.buraks.com/flvmdi/
http://www.realitystorm.com/experiments/flash/streamingFLV/
http://www.flashcomguru.com/index.cfm/2005/11/2/Streaming-flv-video-via-PHP-take-two

In your example that data is discarded.
Here&#039;s what I&#039;m currently using instead:

&lt;pre class=&quot;code&quot;&gt;
    var obj:Object = {};
    var item:String;
    // videoDisplay.metadata;
    var meta:Object = evt.info;
    var value:*;
        for (item in meta) {
            if (meta[item] is Array) {
                value = ArrayUtil.toArray(meta[item]);
            }else{
                value = meta[item]
            }
            obj[item] = value;
        }
    trace(ObjectUtil.toString(obj));
&lt;/pre&gt;</description>
		<content:encoded><![CDATA[<p>If you&#8217;re using Flex 2, don&#8217;t define the metadataReceived event in mxml, define it through ActionScript instead.<br />
The VideoDisplay class is missing the Event tag<br />
    [Event(name="metadataReceived")]<br />
So when defining metadataReceived through mxml you&#8217;ll get an error that no such method exists, allthough it is being dispatched. Adding it through ActionScript in a Script block works fine:</p>
<p>    myVideo.addEventListener(&#8220;metadataReceived&#8221;, metadataReceivedHandler);</p>
<p>I&#8217;m also not clear on why you use an Array to store the metadata data. I&#8217;d use an Object instead and also not exclude nested Array and Object data. For instance, when using Burak&#8217;s metadata injector, data is added with keyframe timestamps that can be used to stream video through PHP or Coldfusion:<br />
<a href="http://www.buraks.com/flvmdi/" rel="nofollow">http://www.buraks.com/flvmdi/</a><br />
<a href="http://www.realitystorm.com/experiments/flash/streamingFLV/" rel="nofollow">http://www.realitystorm.com/experiments/flash/streamingFLV/</a><br />
<a href="http://www.flashcomguru.com/index.cfm/2005/11/2/Streaming-flv-video-via-PHP-take-two" rel="nofollow">http://www.flashcomguru.com/index.cfm/2005/11/2/Streaming-flv-video-via-PHP-take-two</a></p>
<p>In your example that data is discarded.<br />
Here&#8217;s what I&#8217;m currently using instead:</p>
<pre class="code">
    var obj:Object = {};
    var item:String;
    // videoDisplay.metadata;
    var meta:Object = evt.info;
    var value:*;
        for (item in meta) {
            if (meta[item] is Array) {
                value = ArrayUtil.toArray(meta[item]);
            }else{
                value = meta[item]
            }
            obj[item] = value;
        }
    trace(ObjectUtil.toString(obj));
</pre>
]]></content:encoded>
	</item>
	<item>
		<title>By: Webalab</title>
		<link>http://blog.flexexamples.com/2007/09/15/viewing-an-flv-videos-metadata-using-a-flex-videodisplay-control/comment-page-1/#comment-1096</link>
		<dc:creator>Webalab</dc:creator>
		<pubDate>Thu, 15 Nov 2007 00:31:14 +0000</pubDate>
		<guid isPermaLink="false">http://blog.flexexamples.com/2007/09/15/viewing-an-flv-videos-metadata-using-a-flex-videodisplay-control/#comment-1096</guid>
		<description>Just to keep it in mind, if the flv don&#039;t have metadata the metadataReceived event wont be triggered.  so, it depends on the flv file as well...
it will be nice a way to figure that out ( if the file has metadata or not )</description>
		<content:encoded><![CDATA[<p>Just to keep it in mind, if the flv don&#8217;t have metadata the metadataReceived event wont be triggered.  so, it depends on the flv file as well&#8230;<br />
it will be nice a way to figure that out ( if the file has metadata or not )</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: peterd</title>
		<link>http://blog.flexexamples.com/2007/09/15/viewing-an-flv-videos-metadata-using-a-flex-videodisplay-control/comment-page-1/#comment-1095</link>
		<dc:creator>peterd</dc:creator>
		<pubDate>Mon, 17 Sep 2007 19:50:12 +0000</pubDate>
		<guid isPermaLink="false">http://blog.flexexamples.com/2007/09/15/viewing-an-flv-videos-metadata-using-a-flex-videodisplay-control/#comment-1095</guid>
		<description>Rafael,

I built a simple test case and it seems to be working for me in build 182505. Do you know which exact version of the SDK you&#039;re using? If not, you can find out by typing &quot;mxmlc -version&quot; in your target /bin/ directory.

&lt;pre class=&quot;code&quot;&gt;
&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;
&lt;!-- Flex 3 Nightly 182505 --&gt;
&lt;mx:Application xmlns:mx=&quot;http://www.adobe.com/2006/mxml&quot;
        layout=&quot;vertical&quot;
        verticalAlign=&quot;middle&quot;
        backgroundColor=&quot;white&quot;&gt;

    &lt;mx:Script&gt;
        &lt;![CDATA[
            import mx.events.MetadataEvent;

            private function videoDisplay_metadataReceived(evt:MetadataEvent):void {
                lbl.text = evt.type;
            }
        ]]&gt;
    &lt;/mx:Script&gt;

    &lt;mx:VideoDisplay id=&quot;videoDisplay&quot;
            source=&quot;http://www.helpexamples.com/flash/video/cuepoints.flv&quot;
            metadataReceived=&quot;videoDisplay_metadataReceived(event);&quot; /&gt;
    &lt;mx:Label id=&quot;lbl&quot; text=&quot;--default--&quot; /&gt;

&lt;/mx:Application&gt;
&lt;/pre&gt;</description>
		<content:encoded><![CDATA[<p>Rafael,</p>
<p>I built a simple test case and it seems to be working for me in build 182505. Do you know which exact version of the SDK you&#8217;re using? If not, you can find out by typing &#8220;mxmlc -version&#8221; in your target /bin/ directory.</p>
<pre class="code">
&lt;?xml version="1.0" encoding="utf-8"?&gt;
&lt;!-- Flex 3 Nightly 182505 --&gt;
&lt;mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
        layout="vertical"
        verticalAlign="middle"
        backgroundColor="white"&gt;

    &lt;mx:Script&gt;
        &lt;![CDATA[
            import mx.events.MetadataEvent;

            private function videoDisplay_metadataReceived(evt:MetadataEvent):void {
                lbl.text = evt.type;
            }
        ]]&gt;
    &lt;/mx:Script&gt;

    &lt;mx:VideoDisplay id="videoDisplay"
            source="http://www.helpexamples.com/flash/video/cuepoints.flv"
            metadataReceived="videoDisplay_metadataReceived(event);" /&gt;
    &lt;mx:Label id="lbl" text="--default--" /&gt;

&lt;/mx:Application&gt;
</pre>
]]></content:encoded>
	</item>
</channel>
</rss>
