MediaElement repeat play - windows-phone-7

I want to play a video file in mediaelement repeatedly, but when I try to play video again in the MediaEnded event MediaElement clears screen and screen is still clear for some little but appreciable time range. How to decrease this time range or dispose of it?
Thanks.

Could you provide the code for the MediaEnded-event? A bit looking for me resulted in this:
How to: Repeat Media Playback
Social.MSDN: Repeat MediaElement
Perhaps one of these approaches works better?
I also found out that this is a known issue in Silverlight (don't know if this also relates to the WP7 version): Looping with Silverlight media element - a small delay at end of clip before it plays
Hope this helps!

Related

How to capture screen activities in windows phone 8?

i'm new to windows phone 8 and need your help to capture screen activities in a video. I've to make a video of the activities performing on screen?
one solution to this that strike in me is to capture the screen in image form by dispatching a timer at a instance of time but this is not a right way to do as i've to make a video of screen activities? suggest your opinion how to handle this problem.
There's no built in way of doing what you want.
You will need two things:
Do a dispatch timer as you describe
Find code that will encode these frames into a movie. That's not an API that the phone supports - you will need to find existing code and use it. I am not aware of such code existing, but I have only looked for it once or twice and not very hard. You could, potentially, create an MJPG which is a fairly simple video format, but even that's not trivial and the ending file size can be prohibitive.

Switch Mediaelement control

I have one page which contains 2 Media Element Control, first I use one Media Element control to play video(play success) and then I use second Media Element control to play mp3 file but it's not play. I tried to set source = null, call function Stop() to stop first Media Element but Second Media Element is not play. Any body here can help me?. Thanks.
Multiple MediaElements do not seem to be supported, as documented here :-
http://msdn.microsoft.com/en-us/library/ff426928(VS.96).aspx
Hope this helps.
Paul Diston
Multiple MediaElements are not supported but you can use the XNA SoundEffect and the MediaElement.
Playing video and audio at the same time

HTML5 Fullscreen API & performance

I'm coding an app around video content and am currently playing around with HTML5's fullscreen API (I know it is still in very early stage).
Because of what my application does, the video itself isn't the only part that goes fullscreen: several elements alongside go fullscreen too, and I have noticed a great drop in performance there. The video streams ok, but other graphical elements suddenly get painfully slow. For example, a hover style typically takes about a good half second before showing up. A simple change in subtitles (I use popcorn.js) causes the video to freeze for a fraction of a second.
Any one knows why this is so? Do you experience the same? Thanks for your precious feedback.

Mediaplayer.play method taking time

We are developing a XNA game with high interactivity. The game includes some background music.
We are trying to play the background music through the MEdiaplayer.play method. But this seems to block the smooth gameplay for a while. How can this be overcome?
Had tried using the soundeffect instance for this initially and it worked fine. But that approach doesn't seem to go well with the certification requirements. Pls help
Thank You
I think this is normal for large music files. You could however try to put
IsFixedTimeStep = false;
after
TargetElapsedTime = TimeSpan.FromTicks(???);
I have found that that makes a smoother gamepay. At least back in 7.0 - but I still use it.
I of course assume that you use elapsed time for all animations.

WP7 MediaElement Unable to Reposition the stream

I am using MediaElement for video playback in my app. I have added controls for play, pause, rewind and forward. In the forward button's event handler, I am trying to forward the video clip for 5 seconds. the code I have used to do that is given below.
if(myMediaElement.CanSeek)
{
myMediaElement.Position = TimeSpan.FromSeconds(2);
myMediaElement.Play();
}
But the video clip does not forward, instead it stops the video playback. Can anyone please tell me what is going wrong.
You need to start playing the stream before you can set the position.
Move the call to CanSeek and the setting of the position until after the MediaOpened event has been raised.
See the remarks in MSDN http://msdn.microsoft.com/en-us/library/system.windows.controls.mediaelement.position(v=VS.95).aspx for confirmation.
Using valueconverter sample here, with Slider adjustments, to get the positions
http://diggthedrazen.com/2011/07/08/using-an-ivalueconverter-to-create-a-player-with-a-seek-bar-on-windows-phone/

Resources