Page 1 of 1

Playing a video and stopping it after 10 seconds on Android

Posted: Tue Sep 02, 2014 9:16 pm
by charms
Hi there,

I'm playing a video on android and want that it automatically stops after 10 seconds. I do the same with images and browser objects which works. However with the "play video" command it doesn't work.

Code: Select all

play video "/path/to/video/video.mp4"
send "stopPlaying" to me in 10 seconds

on stopPlaying
  play stop
end stopPlaying
The send command doesn't seem to work. The video continues to play. Any idea why this is the case?

After that I've tried with following commands:

Code: Select all

      set the playSelection of the templatePlayer to true
      set the startTime of the templatePlayer to 1000
      set the endTime of the templatePlayer to 2000
      play video "/path/to/video/video.mp4"
This is working on IOS but not on Android.

Using the mobileControlCreate commands is working but this is not an option as the movieTouched event does not fire when using those. Bug report is open for that but I don't know when they'll fix it.

Is there any other way to get around this?

Kind regards,
Chris

Re: Playing a video and stopping it after 10 seconds on Andr

Posted: Thu Sep 11, 2014 5:31 pm
by charms
LiveCode Support provided an answer:

Code: Select all

send "stopPlaying" to me in 10 seconds
play video "/path/to/video/video.mp4"

on stopPlaying
  play stop
end stopPlaying
Send has to be used before play as play locks the send.