This is a migrated thread and some comments may be shown as answers.

Dynamic Paging Media Source

3 Answers 65 Views
MediaPlayer
This is a migrated thread and some comments may be shown as answers.
Naga Sridhar madiraju
Top achievements
Rank 1
Naga Sridhar madiraju asked on 15 May 2013, 09:57 AM
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

3 Answers, 1 is accepted

Sort by
0
Hristo
Telerik team
answered on 17 May 2013, 08:54 AM
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.

0
Naga Sridhar madiraju
Top achievements
Rank 1
answered on 17 May 2013, 09:04 AM
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?
0
Hristo
Telerik team
answered on 20 May 2013, 11:18 AM
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.

Tags
MediaPlayer
Asked by
Naga Sridhar madiraju
Top achievements
Rank 1
Answers by
Hristo
Telerik team
Naga Sridhar madiraju
Top achievements
Rank 1
Share this question
or