Playing a video and stopping it after 10 seconds on Android

LiveCode is the premier environment for creating multi-platform solutions for all major operating systems - Windows, Mac OS X, Linux, the Web, Server environments and Mobile platforms. Brand new to LiveCode? Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
charms
Posts: 122
Joined: Mon Feb 10, 2014 6:21 pm
Contact:

Playing a video and stopping it after 10 seconds on Android

Post by charms » Tue Sep 02, 2014 9:16 pm

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
Attachments
play_test.livecode.zip
Play test stack
(1.54 KiB) Downloaded 241 times

charms
Posts: 122
Joined: Mon Feb 10, 2014 6:21 pm
Contact:

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

Post by charms » Thu Sep 11, 2014 5:31 pm

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.

Post Reply