IIS 7 and Above
Can't set position of media in Smooth Streaming Media Element
Last post Jan 09, 2014 05:01 PM by pp
Mar 19, 2010 02:22 PM|Fly_Molo|LINK
I'm working on a Silverlight player that's using the Smooth Streaming Media Element. When I was using the standard Media Element in Silverlight, I could jump to a position by using:
[code]MediaElement.Position = TimeSpan.FromTicks((long)JumpTo);[/code]
* Note: I've used "JumpTo" as a Double that contains the new position of the video.
For some reason when I try this using the Smooth Streaming Media element, either nothing happens, or the video playback will hang. Is there a solution or a workaround?
Apr 19, 2010 02:23 AM|mihai.stanescu.share|LINK
Sorry for the late response maybe you already found an answer.
SSME has an event called MediaOpened, you have to issue: SSME.Position = TimeSpan; in this event handler.
Yes, you are right Vishal, not just in the MediaOpened handler but anytime after MediaOpened.
Apr 21, 2010 02:25 PM|vsood|LINK
@Fly_Molo - There is only one seek allowed at any point of time as of today (this might change in future). If you need to do multiple seeks, you should queue the seeks in the app by listening to SeekCompleted event. Could you please provide more details
on what part of the code is not working?
To Mihai's point you should be able to do seek anytime after MediaOpened. It should work before that too unless you are uncovering a bug.
Smooth Streaming Client
Apr 21, 2010 04:31 PM|vsood|LINK
Just a clarification:
You can do seeks before MediaOpened, but they will be ignored. This SL behavior as well -
Apr 22, 2010 05:20 AM|mihai.stanescu.share|LINK
One thing Vishal, why do you say: "It should work before that too unless you are uncovering a bug.", because if the media isn't opened you don't know the length of the clip and maybe try to seek at a TimeSpan greater than the entire clip length.
Apr 22, 2010 12:01 PM|vsood|LINK
That is a good point. However, as I clarified what happens in this case is that the position sets are ignored before MediaOpened so technically the value does not matter.
Aug 14, 2011 03:33 AM|JamesWC|LINK
Jun 13, 2012 02:08 PM|truyenle|LINK
Me too, Can't set the position although after media_open and also SeekCompleted. But not always, sometimes yes, sometimes no. I am trying to set it during the video is playing.
Any idea how to fix this?
Jan 09, 2014 05:01 PM|pp|LINK
We are also seeing the same behavior. Setting the position on SSME doesn't work sometimes even after SeekCompleted. In MMP player, we are chaning position in OnMediaOpened event.