Dynamic Paging Media Source

4 posts, 0 answers
  1. Naga Sridhar madiraju
    Naga Sridhar madiraju avatar
    10 posts
    Member since:
    Mar 2010

    Posted 15 May 2013 Link to this post

    HI,

    I am trying to develop an application in which i'll be havinig videos (.wmv) of more than 700 MB size.

    I am splitting the videos into 10 min each block, converting this to byte[] and storing it in sql with start time and end time.

    The things i would like to check is,

    How to manually set the Duration of the video (as it'll be only one block of 10 min, and i want to set total video duration) say, i have a big video of 50 min, I'll be splitting these in to 5 blocks each 10 min, and i want to set the total duration of video to 50 min.

    I'll be loading only one block on to the media player, currently the only event i see for doing this is media ended, what if the user changes the seek position?, so if the video is of 50 min and user seeks the control to 48 min, i'll recognize this as last block video and load the same on to player.

    Help appreciated


    Thanks,
    Sridhar

  2. Hristo
    Admin
    Hristo avatar
    352 posts

    Posted 17 May 2013 Link to this post

    Hello Naga,

    RadMediaPlayer uses internally the MediaElement provided by Microsoft to playback the media. MediaElement API does not support media position outside the position of loaded media. If position outside the media is set it is trimmed to the media end position. In other words RadMediaPlayer does not support position values outside the loaded media range too.

    Having thus said, I am not sure if setting the position to 48 min with a 10 min length movie would be the most straightforward way to implement your solution. I would suggest you to parse the provided by the user position and trim it to the limits of the media that should be played. I.e. setting 48 min would be transformed to 8 min in the 5th movie.
    I am not sure how you are going to display the currently playing position and provide a natural way to the user to seek between movie blocks. Probably you would need to create a custom playback time bar where you will have full control over the position value.

    Please let us know if you need more info or suggested approach does not meet your needs.

    Greetings,
    Hristo
    the Telerik team

    Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

  3. DevCraft banner
  4. Naga Sridhar madiraju
    Naga Sridhar madiraju avatar
    10 posts
    Member since:
    Mar 2010

    Posted 17 May 2013 Link to this post

    HI Hristo 

    Thanks for the details,

    "Probably you would need to create a custom playback time bar where you will have full control over the position value."


    Can i use telerik slider for this? if yes can i please get some thoughts how to go with it?
  5. Hristo
    Admin
    Hristo avatar
    352 posts

    Posted 20 May 2013 Link to this post

    Hi Naga,

    RadSlider would be a good candidate for the task. The basic idea would be to bind the position of RadMediaPlayer to the position of RadSlider. This way the user will interact with the slider and control the playback.
    There are two approaches:
    1) Bind RadSlider.Position directly to RadMediaPlayer.Position and use a converter.
    Using this approach brings the issue of changing the media when users perform a seek.
    2) Bind the RadMediaPlayer.Position to a property in your view-model, then bind that property to the RadSlider.Position.
    When using the second approach your conversion code will be incorporated inside the view-model and changing the media (when converting 48min to 8min in 5th movie) would be more straightforward task.

    All the best,
    Hristo
    the Telerik team

    Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

Back to Top