org.osmf.metadata

# CuePoint - AS3 OSMF

Package | org.osmf.metadata
Class | public class CuePoint
Inheritance | CuePoint TimelineMarker Object

Language Version: | ActionScript 3.0

Product Version: | OSMF 1.0

Runtime Versions: | Flash Player 10, AIR 1.5

The CuePoint class represents a cue point in the timeline of a media element.

A cue point is a media time value that has an associated action or piece of information. Typically, cue points are associated with video timelines to represent navigation points or event triggers.

The CuePoint class extends TimelineMarker, and as such can be added to a TimelineMetadata object.

View the examples

Public Properties
Hide Inherited Public Properties
Show Inherited Public Properties

| Property | Defined By
--- | --- | ---
|  | constructor : Object A reference to the class object or constructor function for a given object instance. | Object
|  | duration : Number [read-only] The duration in seconds. | TimelineMarker
|  | name : String [read-only] The name of the cue point. | CuePoint
|  | parameters : Object [read-only] The parameters of the cue point. | CuePoint
|  | time : Number [read-only] The time in seconds. | TimelineMarker
|  | type : String [read-only] The type of cue point. | CuePoint

Public Methods
Hide Inherited Public Methods
Show Inherited Public Methods

| Method | Defined By
--- | --- | ---
|  | CuePoint(type:String, time:Number, name:String, parameters:Object, duration:Number = NaN) Constructor. | CuePoint
|  | hasOwnProperty(name:String):Boolean Indicates whether an object has a specified property defined. | Object
|  | isPrototypeOf(theClass:Object):Boolean Indicates whether an instance of the Object class is in the prototype chain of the object specified as the parameter. | Object
|  | propertyIsEnumerable(name:String):Boolean Indicates whether the specified property exists and is enumerable. | Object
|  | setPropertyIsEnumerable(name:String, isEnum:Boolean = true):void Sets the availability of a dynamic property for loop operations. | Object
|  | toLocaleString():String Returns the string representation of this object, formatted according to locale-specific conventions. | Object
|  | toString():String Returns the string representation of the specified object. | Object
|  | valueOf():Object Returns the primitive value of the specified object. | Object

Public Constants

| Constant | Defined By
--- | --- | ---
|  | DYNAMIC_CUEPOINTS_NAMESPACE : String = "http://www.osmf.org/timeline/dynamicCuePoints/1.0" [static] Namespace URL for a TimelineMetadata class that exposes dynamic cue points. | CuePoint
|  | EMBEDDED_CUEPOINTS_NAMESPACE : String = "http://www.osmf.org/timeline/embeddedCuePoints/1.0" [static] Namespace URL for a TimelineMetadata class that exposes embedded cue points. | CuePoint

Property Detail

### name

property

`name:String` [read-only]

Language Version: | ActionScript 3.0

Product Version: | OSMF 1.0

Runtime Versions: | Flash Player 10, AIR 1.5

The name of the cue point.

Implementation
`public function get name():String`

### parameters

property

`parameters:Object` [read-only]

Language Version: | ActionScript 3.0

Product Version: | OSMF 1.0

Runtime Versions: | Flash Player 10, AIR 1.5

The parameters of the cue point.

Implementation
`public function get parameters():Object`

### type

property

`type:String` [read-only]

Language Version: | ActionScript 3.0

Product Version: | OSMF 1.0

Runtime Versions: | Flash Player 10, AIR 1.5

The type of cue point. Returns one of the constant values defined in CuePointType.

Implementation
`public function get type():String`
Constructor Detail

### CuePoint

()
Constructor

`public function CuePoint(type:String, time:Number, name:String, parameters:Object, duration:Number = NaN)`

Language Version: | ActionScript 3.0

Product Version: | OSMF 1.0

Runtime Versions: | Flash Player 10, AIR 1.5

Constructor.

Parameters

| `type:String` — The type of cue point specified by one of the const values in CuePointType.
| `time:Number` — The time value of the cue point in seconds.
| `name:String` — The name of the cue point.
| `parameters:Object` — Custom name/value data for the cue point.
| `duration:Number` (default = `NaN`)`` — The duration value for the cue point in seconds.

Constant Detail

### DYNAMIC_CUEPOINTS_NAMESPACE

Constant

`public static const DYNAMIC_CUEPOINTS_NAMESPACE:String = "http://www.osmf.org/timeline/dynamicCuePoints/1.0"`

Namespace URL for a TimelineMetadata class that exposes dynamic cue points.

### EMBEDDED_CUEPOINTS_NAMESPACE

Constant

`public static const EMBEDDED_CUEPOINTS_NAMESPACE:String = "http://www.osmf.org/timeline/embeddedCuePoints/1.0"`

Namespace URL for a TimelineMetadata class that exposes embedded cue points.

Examples How to use this example
CuePointExample.as
Copy

    package
    {
        import flash.display.Sprite;
        import flash.display.StageAlign;
        import flash.display.StageScaleMode;

        import org.osmf.elements.VideoElement;
        import org.osmf.events.MediaElementEvent;
        import org.osmf.events.TimelineMetadataEvent;
        import org.osmf.media.MediaPlayerSprite;
        import org.osmf.media.URLResource;
        import org.osmf.metadata.CuePoint;
        import org.osmf.metadata.TimelineMetadata;

        public class CuePointExample extends Sprite
        {
            public function CuePointExample()
            {
                super();

                stage.scaleMode = StageScaleMode.NO_SCALE;
                stage.align = StageAlign.TOP_LEFT;

                var mediaPlayerSprite:MediaPlayerSprite = new MediaPlayerSprite();
                var urlResource:URLResource = new URLResource("rtmp://cp67126.edgefcs.net/ondemand/mp4:mediapm/osmf/content/test/cuepoints/spacealonehd_sounas_640_with_nav.f4v");
                videoElement= new VideoElement();
                videoElement.resource = urlResource;
                videoElement.addEventListener(MediaElementEvent.METADATA_ADD, onMetadataAdd);

                addChild(mediaPlayerSprite);
                mediaPlayerSprite.media = videoElement;
            }

            private function onMetadataAdd(event:MediaElementEvent):void
            {
                if (event.namespaceURL == CuePoint.DYNAMIC_CUEPOINTS_NAMESPACE)
                {
                    var timelineMetadata:TimelineMetadata = videoElement.getMetadata(CuePoint.DYNAMIC_CUEPOINTS_NAMESPACE) as TimelineMetadata;
                    timelineMetadata.addEventListener(TimelineMetadataEvent.MARKER_TIME_REACHED, onCuePoint);
                }
            }

            private function onCuePoint(event:TimelineMetadataEvent):void
            {
                var cuePoint:CuePoint = event.marker as CuePoint;
                trace("Cue Point at " + cuePoint.time);
            }

            private var videoElement:VideoElement;
        }
    }

© 2015 Adobe Systems Incorporated. All rights reserved.
Mon Apr 10 2017, 12:28 PM -07:00