Can't set position of media in Smooth Streaming Media ElementRSS

8 replies

Last post Jan 09, 2014 05:01 PM by pp

  • Can't set position of media in Smooth Streaming Media Element

    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?

     

    thanks

    Silverlight

  • Re: Can't set position of media in Smooth Streaming Media Element

    Apr 19, 2010 02:23 AM|mihai.stanescu.share|LINK

     Hello fly,

               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.

  • Re: Can't set position of media in Smooth Streaming Media Element

    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

  • Re: Can't set position of media in Smooth Streaming Media Element

    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 - http://msdn.microsoft.com/en-us/library/system.windows.controls.mediaelement.position.aspx.

    Regards,
    Vishal

  • Re: Can't set position of media in Smooth Streaming Media Element

    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.

  • Re: Can't set position of media in Smooth Streaming Media Element

    Apr 22, 2010 12:01 PM|vsood|LINK

    @mihai

    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.

  • Re: Can't set position of media in Smooth Streaming Media Element

    Aug 14, 2011 03:33 AM|JamesWC|LINK

    Dear fly_molo : I bump into the same issue.... I set the Position in the status changed event "Playing". It works. But the player will hang not always but at some critical timing. Could you please tell me some experience of this issue? I was trying to solve the deadlock bug.....But have no idea how to handle this. I suspect the position setting is the key point. Thanks.
  • Re: Can't set position of media in Smooth Streaming Media Element

    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?

  • Re: Can't set position of media in Smooth Streaming Media Element

    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.