Please add currentPlaybackTime to Titanium.Media.VideoPlayer
Would be really useful to have this. Its been in the iOS SDK since 3.2: http://stackoverflow.com/questions/3163388
10 Answers
-
OOOh currentPlaybacktime seems to be already added in 1.6.2 !
BUT, it is not possible to set the value, I add function in TiMediaPlayerProxy.m this way:-(void)setcurrentPlaybackTime:(id)value { [self player].currentPlaybackTime=[TiUtils doubleValue:value]; }
And in your app.js, just write this to seek to the time you want:
VideoPlayer.setcurrentPlaybacktime(15); //For 15 seconds
-
I've managed to use this by adding the following to TiMediaVideoPlayerProxy.m but it would be great if it was in the main code.
-(NSNumber*)currentPlaybackTime { if (movie != nil) { return NUMDOUBLE([[self player] currentPlaybackTime]); } else { RETURN_FROM_LOAD_PROPERTIES(@"initialPlaybackTime", NUMINT(0)); } }
-
Yay! setCurrentPlaybackTime is now supported in 3.1.1.GA!! Thank you Titanium devs. :) No more need for hacks. I am happy.
-
Dears
for backward videoPlayer.setCurrentPlaybackTime($.videoPlayer.getCurrentPlaybackTime()-6000);
for forward videoPlayer.setCurrentPlaybackTime($.videoPlayer.getCurrentPlaybackTime()-6000);please put ur time in milliseconds
-
Totally agree with you, this is a little implementation for great services…Go Go Titanium developper team ! :)
-
hi,
when I use setcurrentPlaybackTime(15) it gives <null> value..why?
-
Does anyone have a solution for the above using sdk 2.0.1 as the above no longer seems to work?
Thanks
-
Up please
-
Is there anyone who can tell how to override this class. I couldn't find the location "/Library/Application Support/Titanium/mobilesdk/osx/17.1/iphone/Classes/TiMediaVideoPlayerProxy.m" I just can find it in my project's build destination and it's cleared whenever I build the project.
-
Here is an updated setcurrentPlaybackTime obj-c function for TiMediaVideoPlayerProxy.m. This works with sdk 2.0.1.GA.
-(void)setcurrentPlaybackTime:(id)time { ENSURE_UI_THREAD_1_ARG(time); if (movie != nil) { NSTimeInterval ourTime = [[time objectAtIndex:0] doubleValue]; if (ourTime > 0) { [movie setCurrentPlaybackTime: ourTime]; } } }