MPTimedMetadata Class Reference

Inherits from
Conforms to
Framework
/System/Library/Frameworks/MediaPlayer.framework
Availability
Available in iOS 4.0 and later.
Declared in
MPMoviePlayerController.h

Overview

An instance of the MPTimedMetadata class, called a timed metadata object, carries time-based information within HTTP streamed media. Content providers can embed such objects when creating a stream. The properties and constants in this class let you extract the metadata as you play the stream using an MPMoviePlayerController object.

For example, the provider of a live sports video stream could use MPTimedMetadata instances to embed game scores, with timestamps, in the stream. On the client side—that is, on the user’s device—their application could employ the properties of this class to update their app’s user interface in real time during the game.

A Javascript implementation of this class is also available for use by web-based applications.

Tasks

Extracting Timed Metadata from a Stream

Properties

allMetadata

A dictionary containing all the metadata in the object. (read-only)

@property (nonatomic, readonly) NSDictionary *allMetadata
Discussion

To retrieve metadata from the dictionary, use the keys described in “Timed Metadata Dictionary Keys.”

Availability
  • Available in iOS 4.0 and later.
Declared In
MPMoviePlayerController.h

key

A key that identifies a piece of timed metadata. (read-only)

@property (nonatomic, readonly) NSString *key
Availability
  • Available in iOS 4.0 and later.
Declared In
MPMoviePlayerController.h

keyspace

The namespace of the identifying key. (read-only)

@property (nonatomic, readonly) NSString *keyspace
Availability
  • Available in iOS 4.0 and later.
Declared In
MPMoviePlayerController.h

timestamp

The timestamp of the metadata, in the timebase of the media stream. (read-only)

@property (nonatomic, readonly) NSTimeInterval timestamp
Availability
  • Available in iOS 4.0 and later.
Declared In
MPMoviePlayerController.h

value

The timed metadata. (read-only)

@property (nonatomic, readonly) id value
Availability
  • Available in iOS 4.0 and later.
Declared In
MPMoviePlayerController.h

Constants

Timed Metadata Dictionary Keys

Dictionary keys for use with the allMetadata property. All keys are optional.

NSString *const MPMoviePlayerTimedMetadataKeyName;
NSString *const MPMoviePlayerTimedMetadataKeyInfo;
NSString *const MPMoviePlayerTimedMetadataKeyMIMEType;
NSString *const MPMoviePlayerTimedMetadataKeyDataType;
NSString *const MPMoviePlayerTimedMetadataKeyLanguageCode;
Constants
MPMoviePlayerTimedMetadataKeyName

The name of the timed metadata key.

Available in iOS 4.0 and later.

Declared in MPMoviePlayerController.h.

MPMoviePlayerTimedMetadataKeyInfo

Arbitrary information about the timed metadata.

Available in iOS 4.0 and later.

Declared in MPMoviePlayerController.h.

MPMoviePlayerTimedMetadataKeyMIMEType

The MIME type for the timed metadata.

Available in iOS 4.0 and later.

Declared in MPMoviePlayerController.h.

MPMoviePlayerTimedMetadataKeyDataType

The data type of the timed metadata.

Available in iOS 4.0 and later.

Declared in MPMoviePlayerController.h.

MPMoviePlayerTimedMetadataKeyLanguageCode

The metadata language, expressed using ISO 639-2, in a string object.

Available in iOS 4.0 and later.

Declared in MPMoviePlayerController.h.

Notifications

MPMoviePlayerTimedMetadataUpdatedNotification

Posted when new timed metadata arrives.
Availability
Declared In
MPMoviePlayerController.h

MPMoviePlayerTimedMetadataUserInfoKey

An NSArray object containing the most recent MPTimedMetadata objects.
Availability
Declared In
MPMoviePlayerController.h