04.02.2013 Views

F4MElement Specification

F4MElement Specification

F4MElement Specification

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

<strong>F4MElement</strong> <strong>Specification</strong><br />

View All <strong>Specification</strong>s<br />

<strong>F4MElement</strong> <strong>Specification</strong><br />

Revision History<br />

Date Author Notes<br />

12/18/09 oconnell Created.<br />

Summary of Feature<br />

The F4MLoader (Manifest Loader) is the implementation of the Flash Media Manifest (F4M) file format.<br />

The F4MLoader will take a manifest file and load it, and create the proper resource for the media element, allowing DRM and MBR<br />

information to be specified by a single manifest file.<br />

This feature introduces the LoadableProxyElement class, which can be used when the actual MediaElement to play is unknown until the<br />

loading of something (like an external manifest file) is complete.<br />

User Stories<br />

User Story: As an OSMF developer, I'd like my OSMF application to be able to load and play media using the new Flash Media Manifest<br />

format. I expect the loading and playback to be consistent with OSMF design metaphors. The loaded media type is unknown until the<br />

manifest loads, meaning that video or audio could be created from the F4M file.<br />

Detailed Description<br />

This feature will include a new Loader, the F4MLoader. It will work with the newly introduced LoadableProxyElement. The<br />

LoadableProxyElement will use the F4MLoader to create a media element. The LoadableProxyElement will then attempt to load the<br />

MediaElement created by the F4MLoader. This flexible design allows the F4MLoader to create any type of element (video, audio etc.), and<br />

use any type of loader (NetLoader or DynamicStreamingNetLoader). The F4MLoader will use a MediaFactory to make these decisions, such<br />

as which loader to use. The specific resource that the F4MLoader will use is a vanilla URLResource that points to the manifest file via HTTP.<br />

The F4MLoader will implement canHandleResource() to detect the .f4m file extension as well as the MIME type for the manifest format.<br />

The developer will need to have a valid manifest file written, which is required to use the F4MLoader. Any other media sent to the F4MLoader<br />

will fail to load, and raise an error.<br />

The F4MLoader accepts subclip metadata on its resource. The resource pointing to an f4m file can contain a start and end time, specified by<br />

a keyvalue facet, using the Subclip namespace. The API for subclips is the same as the one used on VideoElement. See the subclip spec for<br />

more info. Here is an example of subclip for an f4m file:<br />

var res:URLResource = new URLResource(new URL("http://myserver.com/f4mFiles/shuttle-mbr.f4m"));<br />

var kvFacet:KeyValueFacet = new KeyValueFacet(MetadataNamespaces.SUBCLIP_METADATA);<br />

kvFacet.addValue(MetadataNamespaces.SUBCLIP_START_ID, 10);<br />

kvFacet.addValue(MetadataNamespaces.SUBCLIP_END_ID, 30);<br />

res.metadata.addFacet(kvFacet);<br />

API Description


package org.osmf.manifest<br />

{<br />

/**<br />

* The F4MLoader will load the Flash Media Manifest format<br />

* files, generate a NetLoaded context corresponding to the resources<br />

* specified in the f4m file.<br />

*/<br />

public class F4MLoader extends MediaElementLoader<br />

{<br />

// MimeType<br />

public static const F4M_MIME_TYPE: String = "application/f4m+xml" ;<br />

/**<br />

* Generate a new F4MLoader.<br />

* @param factory The factory that is used to create MediaElements based on the<br />

* media specified in the manifest file. A default factory is created for the base OSMF media<br />

* types, Video, Audio, Image, and SWF.<br />

*/<br />

public function F4MLoader(factory:MediaFactory = null);<br />

}<br />

}<br />

package org.osmf.proxies<br />

{<br />

/**<br />

* The LoadableProxyElement will use a custom Loader to load and create a media element.<br />

* The MediaElement will them be used as the proxies wrapped element. The Loader needs<br />

* to return a MediaElementLoadedContext.<br />

*/<br />

public class LoadableProxyElement extends ProxyElement<br />

{<br />

/**<br />

* Creates a new LoadableProxyElement. The Loader needs to return a MediaElementLoadedContext.<br />

*/<br />

public function LoadableProxyElement(loader:MediaElementLoader);<br />

}<br />

/**<br />

* This context carries over the reference to MediaElements created<br />

* by loaders.<br />

*/<br />

public class MediaElementLoadedContext implements ILoadedContext<br />

{<br />

/**<br />

* Creates a new element context.<br />

*/<br />

public function MediaElementLoadedContext(element:MediaElement);<br />

/**<br />

* The Associated MediaElement<br />

*/<br />

public function get element():MediaElement;<br />

}<br />

/**<br />

* The Base class for Chained loaders that are used by the<br />

* LoadableProxyElement.<br />

*/<br />

public class MediaElementLoader extends LoaderBase<br />

{<br />

/**<br />

* Creates a new MediaElementLoader<br />

*/<br />

public function MediaElementLoader();<br />

}<br />

}<br />

Example Usage


private var factory:MediaFactory = new DefaultMediaFactory();<br />

public function init():void<br />

{<br />

factory.addMediaInfo( new MediaInfo( "org.osmf.f4m" , new F4MLoader(factory), createProxyElement));<br />

var urlResource:URLResource = new URLResource( new URL('http: //example.com/manifest.f4m'));<br />

mediaPlayer.element = factory.createMediaElement(urlResource);<br />

}<br />

public function createProxyElement():MediaElement<br />

{<br />

return new LoadableProxyElement( new F4MLoader(factory));<br />

}<br />

Plugin Considerations<br />

Plugins may use the F4MLoader like any other loader in the MediaFramework. It should work out of the box.<br />

Standards Considerations<br />

N/A<br />

Backwards Compatibility<br />

New Feature, N/A<br />

Syntax Changes<br />

N/A<br />

Behavior Changes<br />

N/A<br />

Deprecations<br />

N/A<br />

Future Version Proofing<br />

Most code is kept internal to the org.osmf.manifest package. The parser and object model are marked as internal. The only new public API is<br />

the constructor for F4MLoader and the LoadableProxyElement and related classes.<br />

Implementation Details<br />

The F4MLoader is implemented using a supporting ManifestParser, and Manifest object model. Once the parse takes place, the object model<br />

is converted into a StreamingURLResource or DynamicStreamingResource, which is passed to a new NetLoader. Once the new NetLoader<br />

is complete, the load is finished for the F4MLoader.<br />

The LoadableProxyElement is implemented using the ProxyElement as a super class. The setupOverriddenTraits() method adds the<br />

LoadTrait, which will kick off the manifest load. Once the manifest is loaded the MediaElement is assigned as the proxy's wrapped element.<br />

The Load then is kicked off for the MediaElement (if loadable).<br />

Testing Impact<br />

The testing should consist of sending all variations of the F4M files to the manifest parser. The errors that occur will need to surface as Load<br />

Errors, this includes parse errors. Once the Manifest is successfully parsed the NetLoader should properly load the correct media stream,<br />

which should be tested. Many parser tests will be covered in Unit Testing. Conversion from the Manifest Object Model to a<br />

StreamingURLResource will also need to be unit tested by the dev, as well as black box tested by QE.<br />

Testing should also cover the ability to use the DynamicStreamingNetLoader, and other custom Loaders. Sound should also be able to<br />

appear in a manifest file, and work (as long as the MediaFactory is setup to handle this).<br />

Accessibility


N/A<br />

Performance<br />

Manifest file parsing shouldn't introduce performance issues. Loading may appear slightly longer since there are two required round trips to<br />

the server if a manifest file is introduced.<br />

Internationalization/Localization<br />

No locale specific information in this feature.<br />

Security<br />

This feature doesn't touch any security features, other than DRM, which is interfaced at a high level, on top of already existing DRM APIs.<br />

Legal Issues<br />

N/A<br />

Impacts to Other Products<br />

N/A<br />

Internal Products<br />

N/A<br />

External Partners<br />

N/A<br />

Documentation<br />

The F4M file format will need to be documented. The F4MLoader has simple self documenting ASDoc.<br />

Sample Apps<br />

Examples will be added to ExamplePlayer.<br />

Open Issues<br />

None<br />

Closed Issues<br />

None<br />

References<br />

N/A<br />

Copyright<br />

Copyright © 2006-2009 Adobe Systems Incorporated. All rights reserved. This material may not be copied, photocopied, reproduced,<br />

translated, or converted to any electronic or machine-readable form in whole or in part without written approval from Adobe Systems<br />

Incorporated. Notwithstanding the foregoing, a person obtaining an electronic version of this material from Adobe may print out one copy<br />

provided that no part may be printed out, reproduced, distributed, resold, or transmitted for any other purposes, including, without limitation,<br />

commercial purposes, such as selling copies of this documentation or providing paid-for support services.<br />

Trademarks<br />

Adobe, ActionScript, Flash, Flash Media Server, Flash Player, PostScript, and XMP are either registered trademarks or trademarks of Adobe<br />

Systems Incorporated and may be registered in the United States or in other jurisdictions including internationally. Other product names,


logos, designs, titles, words, or phrases mentioned within this publication may be trademarks, service marks, or trade names of Adobe<br />

Systems Incorporated or other entities and may be registered in certain jurisdictions including internationally. No right or license is granted to<br />

any Adobe trademark.<br />

Third-Party Information<br />

This specification may contain links to third-party websites that are not under the control of Adobe Systems Incorporated, and Adobe<br />

Systems Incorporated is not responsible for the content on any linked site. If you access a third-party website mentioned in this guide, then<br />

you do so at your own risk. Adobe Systems Incorporated provides these links only as a convenience, and the inclusion of the link does not<br />

imply that Adobe Systems Incorporated endorses or accepts any responsibility for the content on those third party sites. No right, license or<br />

interest is granted in any third party technology referenced in this guide.<br />

NOTICE: THIS PUBLICATION AND THE INFORMATION HEREIN IS FURNISHED "AS IS", IS SUBJECT TO CHANGE WITHOUT<br />

NOTICE, AND SHOULD NOT BE CONSTRUED AS A COMMITMENT BY ADOBE SYSTEMS INCORPORATED. ADOBE SYSTEMS<br />

INCORPORATED ASSUMES NO RESPONSIBILITY OR LIABILITY FOR ANY ERRORS OR INACCURACIES, MAKES NO WARRANTY<br />

OF ANY KIND (EXPRESS, IMPLIED, OR STATUTORY) WITH RESPECT TO THIS PUBLICATION, AND EXPRESSLY DISCLAIMS ANY<br />

AND ALL WARRANTIES OF MERCHANTABILITY, FITNESS FOR PARTICULAR PURPOSES, AND NONINFRINGEMENT OF THIRD<br />

PARTY RIGHTS.<br />

Adobe Systems Incorporated, 345 Park Avenue, San Jose, CA 95110, USA<br />

Published July 2009

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!