How to Access Flex 3 VideoDisplay CuePoint Parameters

Unfortunately when adding cuePoint event listener to mx:VideoDisplay component in Adobe Flex 3 you only receive name, time and type of the Cue Point. Here is a dirty workaround to access the parameters from the metadata.

<?xml version="1.0" encoding="utf-8"?>
<s:Application 
               minHeight="600"
               minWidth="955"
               xmlns:fx="http://ns.adobe.com/mxml/2009"
               xmlns:s="library://ns.adobe.com/flex/spark"
               xmlns:mx="library://ns.adobe.com/flex/mx">
    <fx:Script>
        <![CDATA[
            import mx.core.mx_internal;
            import mx.events.MetadataEvent;
            import mx.utils.ObjectUtil;
 
            protected function videoDisplay_metadataReceivedHandler(event:MetadataEvent):void
            {
                videoDisplay.mx_internal::videoPlayer.addEventListener(MetadataEvent.CUE_POINT, videoPlayer_cuePointHandler);
            }
 
            private function videoPlayer_cuePointHandler(event:MetadataEvent):void
            {
                trace(ObjectUtil.toString(event.info.parameters));
            }
        ]]>
    </fx:Script>
    <fx:Declarations>
    </fx:Declarations>
 
    <mx:VideoDisplay id="videoDisplay" source="video.flv" metadataReceived="videoDisplay_metadataReceivedHandler(event)"/>
</s:Application>
Be Sociable, Share!

Leave a Reply