We are developing web television service. And we hope to use osmf framework in a new version. I've just played with sample (HelloWorld) apps and encountered several problems. First is about seek function.
For example I want to seek to N position right after i start to play media (flv video). First i tried this.
public function HelloWorld()
var sprite:MediaPlayerSprite = new MediaPlayerSprite();
sprite.element = new VideoElement( new NetLoader, new URLResource(new URL(REMOTE_PROGRESSIVE)) );
it did play the video but did not seek. Then i tried this (HelloWorld4)
public function HelloWorld4()
element = new VideoElement
( new NetLoader
, new URLResource(new URL(REMOTE_PROGRESSIVE))
var x:* = element.gateway;
var loadable:ILoadable = element.getTrait(MediaTraitType.LOADABLE) as ILoadable;
if (event.newState == LoadState.LOADED)
var viewable:IViewable = element.getTrait(MediaTraitType.VIEWABLE) as IViewable;
var seekable:ISeekable = element.getTrait(MediaTraitType.SEEKABLE) as ISeekable;
var playable:IPlayable = element.getTrait(MediaTraitType.PLAYABLE) as IPlayable;
It did not work. (i also moved seek and play between each other).
I succeed with seeking by attaching it to mouse event. It seems to me that seek is only possible when seek position is already loaded. Is that true?
Please tell me what i'm doing wrong? Is there any way to seek anywhere right after play starts. Or it could be possible only with osmf 0.8 when SubClips are done?
(REMOTE_PROGRESSIVE - is the url to the flv file on server that support progressive download)
A couple of suggestions:
1) Seek can be asynchronous, so you might need to wait until the seek completion event before calling play. If you make this change and it still doesn't work, I recommend you file a bug.
2) It sounds like what you're trying to do is play a subclip of the video, for which we will have framework-level support in our next drop (code is already checked into public trunk). See the Subclip Spec for details.