<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	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/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Flex Examples &#187; metadataReceived</title>
	<atom:link href="http://blog.flexexamples.com/tag/metadatareceived/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.flexexamples.com</link>
	<description>Just a bunch of Adobe Flex Examples</description>
	<lastBuildDate>Wed, 26 Jan 2011 18:09:51 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Viewing a video&#8217;s cue points using a Spark VideoPlayer control in Flex 4</title>
		<link>http://blog.flexexamples.com/2009/05/22/viewing-a-videos-cue-points-using-a-spark-videoplayer-control-in-flex-gumbo/</link>
		<comments>http://blog.flexexamples.com/2009/05/22/viewing-a-videos-cue-points-using-a-spark-videoplayer-control-in-flex-gumbo/#comments</comments>
		<pubDate>Sat, 23 May 2009 06:59:00 +0000</pubDate>
		<dc:creator>Peter deHaan</dc:creator>
				<category><![CDATA[beta1]]></category>
		<category><![CDATA[VideoPlayer (Spark)]]></category>
		<category><![CDATA[cuePoints]]></category>
		<category><![CDATA[Gumbo]]></category>
		<category><![CDATA[metadataInfo]]></category>
		<category><![CDATA[metadataReceived]]></category>

		<guid isPermaLink="false">http://blog.flexexamples.com/2009/05/22/viewing-a-videos-cue-points-using-a-spark-videoplayer-control-in-flex-gumbo/</guid>
		<description><![CDATA[<p>The following example shows how you can determine if a FLV file has cue points by listening for the metadataReceived event on a Spark VideoPlayer control in Flex 4 and then inspecting the VideoEvent object&#8217;s metadataInfo.cuePoints property.</p> <p>Full code after the jump.</p> <p></p> &#60;?xml version="1.0" encoding="utf-8"?&#62; &#60;!-- http://blog.flexexamples.com/2009/05/22/viewing-a-videos-cue-points-using-a-spark-videoplayer-control-in-flex-gumbo/ --&#62; &#60;s:Application name="Spark_VideoPlayer_metadataReceived_cuePoints_test" xmlns:fx="http://ns.adobe.com/mxml/2009" xmlns:s="library://ns.adobe.com/flex/spark" xmlns:mx="library://ns.adobe.com/flex/halo"&#62; &#60;fx:Script&#62; [...]]]></description>
			<content:encoded><![CDATA[<p>The following example shows how you can determine if a FLV file has cue points by listening for the <code>metadataReceived</code> event on a Spark VideoPlayer control in Flex 4 and then inspecting the VideoEvent object&#8217;s <code>metadataInfo.cuePoints</code> property.</p>
<p>Full code after the jump.</p>
<p><span id="more-1087"></span></p>
<p class="alert">The following example(s) require Flash Player 10 and the Adobe Flex 4 SDK. To download the Adobe Flash Builder 4 trial, see <a href="http://bit.ly/crThlI">http://www.adobe.com/products/flex/</a>. To download the latest nightly build of the Flex 4 SDK, see <a href="http://bit.ly/Flex4SDK">http://opensource.adobe.com/wiki/display/flexsdk/Download+Flex+4</a>.<br/><strong>For more information on getting started with Flex 4 and Flash Builder 4, see the official <a href="http://bit.ly/dCkecm">Adobe Flex Team blog</a>.</strong></p>
<pre class="code">
&lt;?xml version="1.0" encoding="utf-8"?&gt;
&lt;!-- http://blog.flexexamples.com/2009/05/22/viewing-a-videos-cue-points-using-a-spark-videoplayer-control-in-flex-gumbo/ --&gt;
&lt;s:Application name="Spark_VideoPlayer_metadataReceived_cuePoints_test"
        xmlns:fx="http://ns.adobe.com/mxml/2009"
        xmlns:s="library://ns.adobe.com/flex/spark"
        xmlns:mx="library://ns.adobe.com/flex/halo"&gt;

    &lt;fx:Script&gt;
        &lt;![CDATA[
            import spark.events.VideoEvent;

            private function videoPlayer_metadataReceived(evt:VideoEvent):void {
                panel.title = videoPlayer.source.toString();
                arrList = new ArrayList(evt.metadataInfo.cuePoints);
            }
        ]]&gt;
    &lt;/fx:Script&gt;

    &lt;fx:Declarations&gt;
        &lt;s:ArrayList id="arrList" /&gt;
    &lt;/fx:Declarations&gt;

    &lt;s:Panel id="panel"
            horizontalCenter="0"
            verticalCenter="0"&gt;
        &lt;s:layout&gt;
            &lt;s:HorizontalLayout /&gt;
        &lt;/s:layout&gt;
        &lt;s:VideoPlayer id="videoPlayer"
                source="http://helpexamples.com/flash/video/cuepoints.flv"
                muted="true"
                metadataReceived="videoPlayer_metadataReceived(event);" /&gt;
        &lt;mx:DataGrid id="dataGrid"
                dataProvider="{arrList}"
                height="100%"&gt;
            &lt;mx:columns&gt;
                &lt;mx:DataGridColumn dataField="name" /&gt;
                &lt;mx:DataGridColumn dataField="time" /&gt;
                &lt;mx:DataGridColumn dataField="type" /&gt;
            &lt;/mx:columns&gt;
        &lt;/mx:DataGrid&gt;
    &lt;/s:Panel&gt;

&lt;/s:Application&gt;
</pre>
<p class="alert">This entry is based on a beta version of the Flex 4 SDK and therefore is very likely to change as development of the Flex SDK continues. The API can (and will) change causing examples to possibly not compile in newer versions of the Flex 4 SDK.</p>
<div class="evernoteSiteMemory"><a href="javascript:" onclick="Evernote.doClip({title: 'Viewing a video\&#039;s cue points using a Spark VideoPlayer control in Flex 4 on FlexExamples.com',url: 'http://blog.flexexamples.com/2009/05/22/viewing-a-videos-cue-points-using-a-spark-videoplayer-control-in-flex-gumbo/',contentID: 'post-1087',code: 'Pete9667',suggestNotebook: 'FlexExamples',suggestTags: 'cuePoints,Gumbo,metadataInfo,metadataReceived',providerName: 'FlexExamples.com',styling: 'text' });return false" class="evernoteSiteMemoryLink"><img src="http://static.evernote.com/article-clipper-remember.png" class="evernoteSiteMemoryButton" />
				</a>				<div class="evernoteSiteMemoryClear">&nbsp;</div>
</div>]]></content:encoded>
			<wfw:commentRss>http://blog.flexexamples.com/2009/05/22/viewing-a-videos-cue-points-using-a-spark-videoplayer-control-in-flex-gumbo/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Viewing a video&#8217;s metadata using a Spark VideoPlayer control in Flex 4</title>
		<link>http://blog.flexexamples.com/2009/05/11/viewing-a-videos-metadata-using-a-spark-videoplayer-control-in-flex-gumbo/</link>
		<comments>http://blog.flexexamples.com/2009/05/11/viewing-a-videos-metadata-using-a-spark-videoplayer-control-in-flex-gumbo/#comments</comments>
		<pubDate>Tue, 12 May 2009 06:59:01 +0000</pubDate>
		<dc:creator>Peter deHaan</dc:creator>
				<category><![CDATA[beta1]]></category>
		<category><![CDATA[VideoEvent]]></category>
		<category><![CDATA[VideoPlayer (Spark)]]></category>
		<category><![CDATA[Gumbo]]></category>
		<category><![CDATA[metadataInfo]]></category>
		<category><![CDATA[metadataReceived]]></category>

		<guid isPermaLink="false">http://blog.flexexamples.com/2009/05/11/viewing-a-videos-metadata-using-a-spark-videoplayer-control-in-flex-gumbo/</guid>
		<description><![CDATA[<p>The following example shows how you can detect when the metadata is received by a Spark VideoPlayer control in Flex 4 by listening for the metadataReceived event.</p> <p></p> &#60;?xml version="1.0" encoding="utf-8"?&#62; &#60;!-- http://blog.flexexamples.com/2009/05/11/viewing-a-videos-metadata-using-a-spark-videoplayer-control-in-flex-gumbo/ --&#62; &#60;s:Application name="Spark_VideoPlayer_metadataReceived_test" xmlns:fx="http://ns.adobe.com/mxml/2009" xmlns:s="library://ns.adobe.com/flex/spark" xmlns:mx="library://ns.adobe.com/flex/halo"&#62; &#60;fx:Script&#62; &#60;![CDATA[ import mx.utils.ObjectUtil; import spark.events.VideoEvent; private function videoPlayer_metadataReceived(evt:VideoEvent):void { debug.text = ObjectUtil.toString(evt.metadataInfo); } ]]&#62; &#60;/fx:Script&#62; [...]]]></description>
			<content:encoded><![CDATA[<p>The following example shows how you can detect when the metadata is received by a Spark VideoPlayer control in Flex 4 by listening for the <code>metadataReceived</code> event.</p>
<p><span id="more-1076"></span></p>
<p class="alert">The following example(s) require Flash Player 10 and the Adobe Flex 4 SDK. To download the Adobe Flash Builder 4 trial, see <a href="http://bit.ly/crThlI">http://www.adobe.com/products/flex/</a>. To download the latest nightly build of the Flex 4 SDK, see <a href="http://bit.ly/Flex4SDK">http://opensource.adobe.com/wiki/display/flexsdk/Download+Flex+4</a>.<br/><strong>For more information on getting started with Flex 4 and Flash Builder 4, see the official <a href="http://bit.ly/dCkecm">Adobe Flex Team blog</a>.</strong></p>
<pre class="code">
&lt;?xml version="1.0" encoding="utf-8"?&gt;
&lt;!-- http://blog.flexexamples.com/2009/05/11/viewing-a-videos-metadata-using-a-spark-videoplayer-control-in-flex-gumbo/ --&gt;
&lt;s:Application name="Spark_VideoPlayer_metadataReceived_test"
        xmlns:fx="http://ns.adobe.com/mxml/2009"
        xmlns:s="library://ns.adobe.com/flex/spark"
        xmlns:mx="library://ns.adobe.com/flex/halo"&gt;

    &lt;fx:Script&gt;
        &lt;![CDATA[
            import mx.utils.ObjectUtil;
            import spark.events.VideoEvent;

            private function videoPlayer_metadataReceived(evt:VideoEvent):void {
                debug.text = ObjectUtil.toString(evt.metadataInfo);
            }
        ]]&gt;
    &lt;/fx:Script&gt;

    &lt;s:HGroup horizontalCenter="0" verticalCenter="0"&gt;
        &lt;s:VideoPlayer id="videoPlayer"
                source="http://helpexamples.com/flash/video/cuepoints.flv"
                muted="true"
                metadataReceived="videoPlayer_metadataReceived(event);" /&gt;

        &lt;s:TextArea id="debug"
                editable="false"
                height="{videoPlayer.height}" /&gt;
    &lt;/s:HGroup&gt;

&lt;/s:Application&gt;
</pre>
<div span="googleAdsLeaderboard">
<script type="text/javascript"><!--
google_ad_client = "pub-3325829455487492";
/* 728x90, created 7/15/09 */
google_ad_slot = "6403511741";
google_ad_width = 728;
google_ad_height = 90;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>
<br />
</div>
<p class="information"><a href="http://blog.flexexamples.com/wp-content/uploads/spark/Spark_VideoPlayer_metadataReceived_test/bin/srcview/">View source</a> is enabled in the following example.</p>
<p><iframe src="http://blog.flexexamples.com/wp-content/uploads/spark/Spark_VideoPlayer_metadataReceived_test/bin/main.html" width="100%" height="350"></iframe></p>
<p>Due to popular demand, here is the &#8220;same&#8221; example in a more ActionScript friendly format:</p>
<pre class="code">
&lt;?xml version="1.0" encoding="utf-8"?&gt;
&lt;!-- http://blog.flexexamples.com/2009/05/11/viewing-a-videos-metadata-using-a-spark-videoplayer-control-in-flex-gumbo/ --&gt;
&lt;s:Application name="Spark_VideoPlayer_metadataReceived_test"
        xmlns:fx="http://ns.adobe.com/mxml/2009"
        xmlns:s="library://ns.adobe.com/flex/spark"
        xmlns:mx="library://ns.adobe.com/flex/halo"
        initialize="init();"&gt;

    &lt;fx:Script&gt;
        &lt;![CDATA[
            import mx.events.ResizeEvent;
            import mx.utils.ObjectUtil;
            import spark.components.HGroup;
            import spark.components.TextArea;
            import spark.components.VideoPlayer;
            import spark.events.VideoEvent;

            private var videoPlayer:VideoPlayer;
            private var debug:TextArea;

            private function init():void {
                videoPlayer = new VideoPlayer();
                videoPlayer.source = "http://helpexamples.com/flash/video/cuepoints.flv";
                videoPlayer.muted = true;
                videoPlayer.addEventListener(VideoEvent.METADATA_RECEIVED, videoPlayer_metadataReceived);
                videoPlayer.addEventListener(ResizeEvent.RESIZE, videoPlayer_resize);

                debug = new TextArea();
                debug.editable = false;

                var hGr:HGroup = new HGroup();
                hGr.horizontalCenter = 0;
                hGr.verticalCenter = 0;
                hGr.addElement(videoPlayer);
                hGr.addElement(debug);
                addElement(hGr);
            }

            private function videoPlayer_resize(evt:ResizeEvent):void {
                debug.height = videoPlayer.height;
            }

            private function videoPlayer_metadataReceived(evt:VideoEvent):void {
                debug.text = ObjectUtil.toString(evt.metadataInfo);
            }
        ]]&gt;
    &lt;/fx:Script&gt;

&lt;/s:Application&gt;
</pre>
<p class="alert">This entry is based on a beta version of the Flex 4 SDK and therefore is very likely to change as development of the Flex SDK continues. The API can (and will) change causing examples to possibly not compile in newer versions of the Flex 4 SDK.</p>
<div class="evernoteSiteMemory"><a href="javascript:" onclick="Evernote.doClip({title: 'Viewing a video\&#039;s metadata using a Spark VideoPlayer control in Flex 4 on FlexExamples.com',url: 'http://blog.flexexamples.com/2009/05/11/viewing-a-videos-metadata-using-a-spark-videoplayer-control-in-flex-gumbo/',contentID: 'post-1076',code: 'Pete9667',suggestNotebook: 'FlexExamples',suggestTags: 'Gumbo,metadataInfo,metadataReceived',providerName: 'FlexExamples.com',styling: 'text' });return false" class="evernoteSiteMemoryLink"><img src="http://static.evernote.com/article-clipper-remember.png" class="evernoteSiteMemoryButton" />
				</a>				<div class="evernoteSiteMemoryClear">&nbsp;</div>
</div>]]></content:encoded>
			<wfw:commentRss>http://blog.flexexamples.com/2009/05/11/viewing-a-videos-metadata-using-a-spark-videoplayer-control-in-flex-gumbo/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>Viewing an FLV video&#8217;s metadata using a Flex VideoDisplay control</title>
		<link>http://blog.flexexamples.com/2007/09/15/viewing-an-flv-videos-metadata-using-a-flex-videodisplay-control/</link>
		<comments>http://blog.flexexamples.com/2007/09/15/viewing-an-flv-videos-metadata-using-a-flex-videodisplay-control/#comments</comments>
		<pubDate>Sun, 16 Sep 2007 06:16:28 +0000</pubDate>
		<dc:creator>Peter deHaan</dc:creator>
				<category><![CDATA[MetadataEvent]]></category>
		<category><![CDATA[VideoDisplay]]></category>
		<category><![CDATA[metadata]]></category>
		<category><![CDATA[metadataReceived]]></category>

		<guid isPermaLink="false">http://blog.flexexamples.com/2007/09/15/viewing-an-flv-videos-metadata-using-a-flex-videodisplay-control/</guid>
		<description><![CDATA[<p>The following example shows how you can use the new metadataReceived event in Flex 3 to easily grab the metadata from an FLV file.</p> <p>Full code after the jump.</p> <p></p> <p class="download"><a href="http://blog.flexexamples.com/wp-content/uploads/VideoDisplay_metadataReceived_test/main.mxml">View MXML</a></p> &#60;?xml version=&#34;1.0&#34; encoding=&#34;utf-8&#34;?&#62; &#60;!-- http://blog.flexexamples.com/2007/09/15/viewing-an-flv-videos-metadata-using-a-flex-videodisplay-control/ --&#62; &#60;mx:Application xmlns:mx=&#34;http://www.adobe.com/2006/mxml&#34; layout=&#34;vertical&#34; verticalAlign=&#34;middle&#34; backgroundColor=&#34;white&#34;&#62; &#60;mx:Script&#62; &#60;![CDATA[ import mx.events.MetadataEvent; import mx.utils.ObjectUtil; private const VIDEO_URL:String = [...]]]></description>
			<content:encoded><![CDATA[<p>The following example shows how you can use the new <code>metadataReceived</code> event in Flex 3 to easily grab the metadata from an FLV file.</p>
<p>Full code after the jump.</p>
<p><span id="more-185"></span></p>
<p class="download"><a href="http://blog.flexexamples.com/wp-content/uploads/VideoDisplay_metadataReceived_test/main.mxml">View MXML</a></p>
<pre class="code">
&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;
&lt;!-- http://blog.flexexamples.com/2007/09/15/viewing-an-flv-videos-metadata-using-a-flex-videodisplay-control/ --&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;
            import mx.utils.ObjectUtil;

            private const VIDEO_URL:String = &quot;http://www.helpexamples.com/flash/video/cuepoints.flv&quot;;

            private function videoDisplay_metadataReceived(evt:MetadataEvent):void {
                var arr:Array = [];
                var item:String;
                var meta:Object = evt.info; // videoDisplay.metadata;
                var value:*;
                for (item in meta) {
                    if (ObjectUtil.isSimple(meta[item])) {
                        if (meta[item] is Array) {
                            value = &quot;[Array]&quot;;
                        } else {
                            value = meta[item]
                        }
                        arr.push({name:item, value:value});
                    }
                }
                arr.sortOn(&quot;name&quot;, Array.CASEINSENSITIVE);
                dataGrid.dataProvider = arr;
                dataGrid.visible = true;
            }
        ]]&gt;
    &lt;/mx:Script&gt;

    &lt;mx:Button label=&quot;Click here to load video&quot;
            click=&quot;videoDisplay.source = VIDEO_URL;&quot; /&gt;

    &lt;mx:VideoDisplay id=&quot;videoDisplay&quot;
            visible=&quot;false&quot;
            ready=&quot;videoDisplay.visible = true;&quot;
            metadataReceived=&quot;videoDisplay_metadataReceived(event);&quot; /&gt;

    &lt;mx:DataGrid id=&quot;dataGrid&quot;
            visible=&quot;false&quot;
            width=&quot;100%&quot;
            height=&quot;100%&quot; &gt;
        &lt;mx:columns&gt;
            &lt;mx:DataGridColumn dataField=&quot;name&quot;
                    headerText=&quot;Name:&quot;
                    sortable=&quot;false&quot; /&gt;
            &lt;mx:DataGridColumn dataField=&quot;value&quot;
                    headerText=&quot;Value:&quot;
                    sortable=&quot;false&quot; /&gt;
        &lt;/mx:columns&gt;
    &lt;/mx:DataGrid&gt;

&lt;/mx:Application&gt;
</pre>
<p class="information"><a href="http://blog.flexexamples.com/wp-content/uploads/VideoDisplay_metadataReceived_test/bin/srcview/index.html">View source</a> is enabled in the following example.</p>
<p><iframe src="http://blog.flexexamples.com/wp-content/uploads/VideoDisplay_metadataReceived_test/bin/main.html" width="100%" height="450"></iframe></p>
<div class="evernoteSiteMemory"><a href="javascript:" onclick="Evernote.doClip({title: 'Viewing an FLV video\&#039;s metadata using a Flex VideoDisplay control on FlexExamples.com',url: 'http://blog.flexexamples.com/2007/09/15/viewing-an-flv-videos-metadata-using-a-flex-videodisplay-control/',contentID: 'post-185',code: 'Pete9667',suggestNotebook: 'FlexExamples',suggestTags: 'metadata,metadataReceived',providerName: 'FlexExamples.com',styling: 'text' });return false" class="evernoteSiteMemoryLink"><img src="http://static.evernote.com/article-clipper-remember.png" class="evernoteSiteMemoryButton" />
				</a>				<div class="evernoteSiteMemoryClear">&nbsp;</div>
</div>]]></content:encoded>
			<wfw:commentRss>http://blog.flexexamples.com/2007/09/15/viewing-an-flv-videos-metadata-using-a-flex-videodisplay-control/feed/</wfw:commentRss>
		<slash:comments>17</slash:comments>
		</item>
	</channel>
</rss>

