How to use "currentTime" property for MpMoviePlayerController - time

I am trying to use the property of MPMoviePlayerController i.e "currentTime". But its showing warning "warning: 'MPMoviePlayerController' may not respond to '-currentTime' ". Can you please help me for how to use this property.
Actually i am trying to find out the duration of time for played video . So that i will check with timer ( NSTimer ) and than calculate how much time the played video is played or seek forward . And next time while i am playing the same video so i will start from the last spot time and play from that time when i resumed .
Thanks,
KamalBhr.

You would not see currentTime as part of MPMoviePlayerController thats a part of AVPlayer.

Related

Mac control center "now playing" info not showing duration over 1h

For a Mac app I'm trying to use the MPNowPlayingInfoCenter with playback controls and track info.
I'm using the MPMediaItemPropertyPlaybackDuration property to set the track duration, with the number of seconds as NSNumber wrapped value.
Tracks over 1 hour do not show the full duration and roll over at 59:59.
Is there any way to make items in the control center show their full duration & elapsed time?
Notes:
The image shows Control center information for a track with a duration of 1:52:33 and current play position is 1:00:05.
The seek bar works correctly.
That looks like a macOS bug since media played using QuickTime Player also exhibits the same erroneous behavior. Please file a macOS feedback report!

Set start time AVUrlAsset using CMTime for Xamarin

I am trying to merge an audio in video but this custom audio does not necessarily from the beginning. The user listens for a music and then if the user feels like want to start the video recording, the user will tap on a button that starts the video recording while the music is playing.
So the user could start after 20 or 32 seconds after the audio started.
I have no problem in merging, but my problem is understanding how to set the CMTimeRange.Start using CMTime for my audio background.
The Start time value is a .NET's TimeSpan, now for example the user started after 32 seconds
var startTime = new TimeSpan(0,0,32);
or the user started after 53 seconds and then starts the video recording.
how do you translate this to CMTime?
First, we get the seconds From TimeSpan by using
TimeSpan span;
double time = span.TotalSeconds
Then ,we have to understand CMTime and how to translate float values to it.
Here you can refer to .
CMTime has a value and a timescale field, and time = value/timescale .

ios7 musicplay in background with time

Music player in ios7 change
First I find "remoteControlReceivedWithEvent" changed in ios7,as,"UIEventSubtypeRemoteControlTogglePlayPause:" is useless and change to
"UIEventSubtypeRemoteControlPause:"
"UIEventSubtypeRemoteControlPlay:"
and then I found ios7 MuiscPlay in bacground appear time.. and my player's time is empty like this:https://www.dropbox.com/s/l84wxl2jl4z3hr3/2013-11-11%2019.09.36.png
and how can I get the time with duration and current..
Thank you for your reading, hope you can help me。

MediaElement repeat play

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!

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