Triggering Events At Specific Player Times?
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
Triggering Events At Specific Player Times?
Hi All...
Is it possible to trigger events at specific times during the playback of a movie or an audio file in iOS? I had looked at an older CallBacks tutorial but callbacks are not iOS compatible.
I also noticed there is a mobileControlGet (player_id, currentTime) but I was not sure how I could report out that currentTime while a media played along. My original plan was checking the currentTime while the media played and then acting on the reported time when it was at specific times.
Is there an example stack of using currentTime in this manner? Or is reporting the currentTime, while a piece of media plays not possible?
Thank you!
Is it possible to trigger events at specific times during the playback of a movie or an audio file in iOS? I had looked at an older CallBacks tutorial but callbacks are not iOS compatible.
I also noticed there is a mobileControlGet (player_id, currentTime) but I was not sure how I could report out that currentTime while a media played along. My original plan was checking the currentTime while the media played and then acting on the reported time when it was at specific times.
Is there an example stack of using currentTime in this manner? Or is reporting the currentTime, while a piece of media plays not possible?
Thank you!
Re: Triggering Events At Specific Player Times?
Try something like this:
Gerry
Code: Select all
on playmovie
mobileControlDo "myPlayerControl", "play"
send "trackCurrentTime" to this card in 1 second
end playmovie
on trackCurrentTime
put mobileControlGet ("myPlayerControl", "currenttime") into currentMovieTime
switch
case currentMovieTime = 5
show image "5 seconds"
break
case currentMovieTime = 10
show image "10 seconds"
break
end switch
send "trackCurrentTime" to this card in 1 second
end trackCurrentTime
14" MacBook Pro
Former LiveCode developer.
Now recovering.
Former LiveCode developer.
Now recovering.
Re: Triggering Events At Specific Player Times?
Oh and put that code in the card script.
Gerry
Gerry
14" MacBook Pro
Former LiveCode developer.
Now recovering.
Former LiveCode developer.
Now recovering.
Re: Triggering Events At Specific Player Times?
I wonder if the case should be padded?
case min(5.05,max(currentMovieTime,4.95))
because of currentMovieTime is in millisecs.
Simon
Edit: Nah that isn't it.
Just a plain old
case currentMovieTime >=4.95 and currentMovieTime <=5.05
case min(5.05,max(currentMovieTime,4.95))
because of currentMovieTime is in millisecs.
Simon
Edit: Nah that isn't it.
Just a plain old
case currentMovieTime >=4.95 and currentMovieTime <=5.05
I used to be a newbie but then I learned how to spell teh correctly and now I'm a noob!
Re: Triggering Events At Specific Player Times?
Simon
Shhhhhh. Leave her/him something to work out on her/his own
Gerry
Shhhhhh. Leave her/him something to work out on her/his own

Gerry
14" MacBook Pro
Former LiveCode developer.
Now recovering.
Former LiveCode developer.
Now recovering.
Re: Triggering Events At Specific Player Times?
Thanks Gerry and Simon!
I just took the easy way out and rounded
put the round of (mobileControlGet ("iosControl", "currenttime")/1000) & " seconds" into cd fld "videoTime"
Cheers!
I just took the easy way out and rounded

put the round of (mobileControlGet ("iosControl", "currenttime")/1000) & " seconds" into cd fld "videoTime"
Cheers!