3 Replies Latest reply on Dec 3, 2009 11:16 AM by mxc

    Temporalfacet Cue Points

    mxc Level 1

      Hey Forum

       

      I have just read the OSMF blog about the new CuePoints in sprint 7, it looks very promising although not as straight forward as OVP.

      I was wondering if there is a best practice in implementing Actionscript cuepoints.

      User case:  there is a need for a slide show where each image is changed according to the cuepoints.

      We add the Actionscript cuepoints to the temporal facet and add the TemporalFacetEvent.POSITION_REACHED event to the facet... easy.

      Now all we need to do is load the correct image in a cuepoint reached event handler... seemingly not so easy

       

      In OVP the cuepoint reached event contains all the cuepoint data so its quite easy to access the image name, id etc.

      The TemporalFacetEvent does not seem to allow the same access to the data.

      Is this because its still under development or is there another OSMF specific way to approach this problem?

      Keep up the good work! Roll on OSMF beta!!

       

      regards

      Micheal

        • 1. Re: Temporalfacet Cue Points
          mxc Level 1

          Ok the light dawns! Been testing some stuff and although the TemporalFacetEvent cannot be accessed directly its .value contains the cuepoint object and can therefore be accessed indirectly. So now my slide events are up and running.

          I would like to see some more example code on this though sometime in the future..the use of namespaces in the facet needs some further explanation for example. And should the slide images be loaded in another element such as media element or whats the best approach here? Right now I just load the images into an image component(workin' in Flex);

           

          regards

          Micheal

          • 2. Re: Temporalfacet Cue Points
            charles_newman-6QjwQx

            Hi Micheal,

             

            You probably noticed the CuePoint object in the TemporalFacetEvent contains the "parameters" property which can contain whatever key/value pairs you set.

             

            The purpose of the namespaces in the facet is to allow you to differentiate between the various TemporalFacets that are added to the MediaElement. If you take a look at the CuePointSample app, you can see it adds it's own cue points at run time and assigns it own custom namespace to those so it can differentiate between those and the cue points added by the framework.  That is the purpose of the namespaces.

             

            The new captioning plugin will have it's own namespace.  This allows player code to either have a separate listener for each TemporalFacet, or have one listener and be able to react differently based on the namespace, for example:

             

                        private function onTemporalFacetEvent(event:TemporalFacetEvent):void
                        {
                            var ns:URL = (event.currentTarget as TemporalFacet).namespaceURL;
                           
                             if (ns == MetadataNamespaces.TEMPORAL_METADATA_EMBEDDED)
                            {
                                // We are getting this from an http delivered media element, these cue points were embedded at encoding time

                                var cuePoint:CuePoint = event.value as CuePoint;
                            }
                            else if (ns == MetadataNamespaces.TEMPORAL_METADATA_DYNAMIC)
                            {
                                // We are getting this from the framework, for example in the case of a streaming F4V. The framework is dispatching

                                // these because there is no in-stream cue point event for F4V files, the framework reads them from the onMetadata

                                // callback and dispatches these events at the proper time.

                                var cuePoint:CuePoint = event.value as CuePoint;
                            }

                           else if (ns == CaptioningPluginInfo.CAPTIONING_TEMPORAL_METADATA_NAMESPACE)

                           {

                                // We are getting this from the captioning plugin and the event.value is a Caption Object

                                var caption:Caption = event.value as Caption;

                           }

                        }

             

            Hope that helps,

            - charles

            • 3. Re: Temporalfacet Cue Points
              mxc Level 1

              Thanks a lot for your reply. That explains it perfectly.

               

              regards

              Micheal