So I have a little more detail on my question now. I have a videoElement which goes and gets me the video from the beginning in the first instance. I get the metadata from this and build a list of the keyframes. I then send a request to the server by changing the videoElements URLResource to point to the url for the getPartialVideo service i have and give it the "?start=byteoffset" number of the keyframe i want to jump to. This goes to the server and seems to return without any errors. When the next mediaplayercapabilitiesChangedEvent fires i check if the player can play and then play it. However visually my player is still paused.
Any idea's greatfully received.
So initially i call his giving the byteoffset in the url as 0. This returns and plays the video fine.
private function playVideoURL():void
mediaPlayer.addEventListener( MediaPlayerCapabilityChangeEvent.CAN_PLAY_CHANGE, onVideoLoadedAndReady );
mediaPlayer.addEventListener( MediaPlayerCapabilityChangeEvent.CAN_SEEK_CHANGE, onCanSeekChange );
mediaPlayer.addEventListener( MediaPlayerCapabilityChangeEvent.HAS_DISPLAY_OBJECT_CHANGE, hasDispObjChanged );
mediaPlayer.addEventListener( DisplayObjectEvent.MEDIA_SIZE_CHANGE, onDimensionChange );
videoElement = new VideoElement( new URLResource( url+0 ), new HTTPStreamingNetLoader() );
mediaPlayer.media = videoElement;
mediaPlayer.displayObject.width = videoWidth;
mediaPlayer.displayObject.height = videoHeight;
mediaHolder.addChild( mediaPlayer.displayObject );
mediaHolder.addChild( playerContainer );
On canSeekChange is where i add a handler to get the metadata.
private function onCanSeekChange( event:MediaPlayerCapabilityChangeEvent ):void
trace("CAN_SEEK EVENT FIRED");
canSeek = true;
bytesTotal = mediaPlayer.bytesTotal;
This method see's that the video is ready to play and plays it. This is where it is not playing when i get the second offset
private function onVideoLoadedAndReady(event:MediaPlayerCapabilityChangeEvent):void
if (event.enabled && mediaPlayer.canPlay)
This is where i suspect i have some bits missing and am not doing something with the player to set it to play when it gets the new stream?
private function seekHandler(event:Event):void
url = url + skipTo.text;
videoElement.resource = new URLResource( url );
Would you please send me the complete project such that I can do some debugging for you? I am an OSMF developer at Adobe and more than happy to help you out on this. You may contact me directly via my company email firstname.lastname@example.org.
Senior Computer Scientist