Eureka... How to play a movie inside a stack on Lubuntu

Deploying to Linux? Get penguinated here.

Moderators: Klaus, FourthWorld, heatherlaine, robinmiller, kevinmiller

capellan
Posts: 527
Joined: Wed Aug 15, 2007 11:09 pm
Contact:

Eureka... How to play a movie inside a stack on Lubuntu

Post by capellan » Sun Dec 15, 2013 6:41 pm

Hi All,

Using shell commands, you could play media (audio and video) inside the window of a stack in Lubuntu 13.10

For mPlayer:
shell("mplayer -wid 25166356 -ontop -noborder -geometry 50%:50% -quiet -ss 12 -xy 0.5 mymovie.mp4")

For VLC:
shell("vlc -I dummy --play-and-exit --drawable-xid 23069197 mymovie.mp4 ")

Notice these switchs: -wid 25166356 and --drawable-xid 23069197
It tells to mplayer and VLC, which windows must use to play the media file.
To play media inside a stack, we need the LiveCode stack´s windows ID:

put the windowid of topstack

This function returns a number like: 25166356

Interesting enough, the movie resizes itself when we change the stack size. In Lubuntu, using the mouse pointer, we could move and resize freely the stack while the movie is playing , with VLC it´s possible to stop, pause, rewind, forward, change volume, etc... using the keyboard keys. Do not works with mPlayer, at least in the version installed from the CD.

Could you try these shell command in your own setup and report your results back?

Read both manuals, if you want to test many others commands:
http://www.mplayerhq.hu/DOCS/man/en/mplayer.1.html
https://wiki.videolan.org/VLC_command-line_help/

Now, we only need a reliable way to control the movie inside the stack, without using direct shell commands that completely blocks LiveCode while the media is playing. Warren Samples suggested that using FIFO or Sockets this is feasible.

Let´s hope that one of the experts in sockets and inter-application communication reads this thread and finds time to help. :D

A Media Player floating inside his own stack window is useful in many ways, until an embedded player became available.
We just need a better way to control it.

Thanks in advance!

Al

FourthWorld
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 6230
Joined: Sat Apr 08, 2006 7:05 am
Location: Los Angeles
Contact:

Re: Eureka... How to play a movie inside a stack on Lubuntu

Post by FourthWorld » Sun Dec 15, 2013 7:47 pm

Many of the issues with playing video on Linux are documented in the RQCC. If you come across issues not noted there it woud be helpful if you could file a new report for them.

It's my understanding that this and other media-playback issues will be addressed under the Multimedia section of the Road Map, currently queued after completion of Unicode and 64-bit compatibility.
Richard Gaskin
Community volunteer LiveCode Community Liaison

LiveCode development, training, and consulting services: Fourth World Systems: http://FourthWorld.com
LiveCode User Group on Facebook : http://FaceBook.com/groups/LiveCodeUsers/

capellan
Posts: 527
Joined: Wed Aug 15, 2007 11:09 pm
Contact:

Re: Eureka... How to play a movie inside a stack on Lubuntu

Post by capellan » Sun Dec 15, 2013 8:10 pm

Ah. This is good news. Meanwhile:

http://forums.runrev.com/viewtopic.php?f=20&t=18430
How could we use FIFO from LiveCode on Linux?

Thanks in advance!

Al

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 2792
Joined: Fri Feb 19, 2010 10:17 am
Location: Bulgaria
Contact:

Re: Eureka... How to play a movie inside a stack on Lubuntu

Post by richmond62 » Mon Dec 16, 2013 7:05 pm

Roll on a media player inwith the Livecode system.
LC_gadfly.png

capellan
Posts: 527
Joined: Wed Aug 15, 2007 11:09 pm
Contact:

Re: Eureka... How to play a movie inside a stack on Lubuntu

Post by capellan » Fri Feb 26, 2016 12:10 am

Just an update for this code posted previously
at the beginning of this forum thread:

To play a movie inside a stack under Ubuntu Linux,
put a movie named (or renamed) fv.mp4 into
Home folder and paste this code in a button of a stack:

on mouseUp
put the windowid of this stack into myWindowID

get shell("vlc -I dummy --play-and-exit --drawable-xid" && myWindowID && "fv.mp4")
-- If you want to use mpv player, comment previous line and
-- uncomment this next line
-- get shell ("mpv -wid" && myWindowID && "-ontop -geometry 50%:50% -quiet -start 12 -autofit 50% fv.mp4")

put it
end mouseUp

VLC command line reference:
https://wiki.videolan.org/VLC_command-line_help/

MPV command line reference:
http://manpages.ubuntu.com/manpages/tru ... mpv.1.html

FourthWorld
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 6230
Joined: Sat Apr 08, 2006 7:05 am
Location: Los Angeles
Contact:

Re: Eureka... How to play a movie inside a stack on Lubuntu

Post by FourthWorld » Fri Feb 26, 2016 12:44 am

Very nice. It hangs LC until it's done, but I think if we use open process instead we can get around that. Have you been able to find the CLI call to stop a playing video?
Richard Gaskin
Community volunteer LiveCode Community Liaison

LiveCode development, training, and consulting services: Fourth World Systems: http://FourthWorld.com
LiveCode User Group on Facebook : http://FaceBook.com/groups/LiveCodeUsers/

MaxV
Posts: 1542
Joined: Tue May 28, 2013 2:20 pm
Location: Italy
Contact:

Re: Eureka... How to play a movie inside a stack on Lubuntu

Post by MaxV » Wed May 04, 2016 9:15 am

To play videos with Linux, you just need MPlayer installed. Livecode player uses Mplayer on Linux.
It works great with any video.
Image

You don't need to use the shell() function.
Livecode Wiki: http://livecode.wikia.com
My blog: http://livecodeitalia.blogspot.it
To post code use this: http://tinyurl.com/ogp6d5w

FourthWorld
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 6230
Joined: Sat Apr 08, 2006 7:05 am
Location: Los Angeles
Contact:

Re: Eureka... How to play a movie inside a stack on Lubuntu

Post by FourthWorld » Wed May 04, 2016 3:06 pm

MaxV wrote:To play videos with Linux, you just need MPlayer installed. Livecode player uses Mplayer on Linux.
It works great with any video.
Neither Alejandro or myself has mad much luck with that. Which version of Lubuntu are you running, and which version of LC?
Richard Gaskin
Community volunteer LiveCode Community Liaison

LiveCode development, training, and consulting services: Fourth World Systems: http://FourthWorld.com
LiveCode User Group on Facebook : http://FaceBook.com/groups/LiveCodeUsers/

MaxV
Posts: 1542
Joined: Tue May 28, 2013 2:20 pm
Location: Italy
Contact:

Re: Eureka... How to play a movie inside a stack on Lubuntu

Post by MaxV » Wed May 04, 2016 4:17 pm

I use Linux Mint, but it's always Ubuntu based.
Just keep in mind that is better to use livecode buttons to play or stop the player; so:
  1. add a player
  2. set player fileName
  3. add a PLAY button with this code: start player 1
  4. add a STOP button with this code: stop player 1
  5. test it
Livecode Wiki: http://livecode.wikia.com
My blog: http://livecodeitalia.blogspot.it
To post code use this: http://tinyurl.com/ogp6d5w

FourthWorld
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 6230
Joined: Sat Apr 08, 2006 7:05 am
Location: Los Angeles
Contact:

Re: Eureka... How to play a movie inside a stack on Lubuntu

Post by FourthWorld » Wed May 04, 2016 7:43 pm

Thanks, Max, but still no-go for me, as reported in this confirmed bug report:
http://quality.livecode.com/show_bug.cgi?id=14427

Maybe I should switch to Mint. :)
Richard Gaskin
Community volunteer LiveCode Community Liaison

LiveCode development, training, and consulting services: Fourth World Systems: http://FourthWorld.com
LiveCode User Group on Facebook : http://FaceBook.com/groups/LiveCodeUsers/

MaxV
Posts: 1542
Joined: Tue May 28, 2013 2:20 pm
Location: Italy
Contact:

Re: Eureka... How to play a movie inside a stack on Lubuntu

Post by MaxV » Thu May 05, 2016 10:57 am

probably you have just to install all mplayer packages.
Ubuntu packages tends to split a software to many packages: skins, codecs, etc.
Livecode Wiki: http://livecode.wikia.com
My blog: http://livecodeitalia.blogspot.it
To post code use this: http://tinyurl.com/ogp6d5w

FourthWorld
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 6230
Joined: Sat Apr 08, 2006 7:05 am
Location: Los Angeles
Contact:

Re: Eureka... How to play a movie inside a stack on Lubuntu

Post by FourthWorld » Thu May 05, 2016 3:24 pm

In addition to having installed mplayer I also have Ubuntu Restricted Extras, the entire VLC suite, the extra Handbreak codecs, and a few others. Normally when a codec isn't present the symptom is gentler than a crash.

If you can use the player object in Mint but no one else that I've talked to about this can use it in any Ubuntu flavor it would seem the difference may lie with the desktop manager or some other more fundamental component.

The bug has been confirmed by the team, and we look forward to seeing it fixed at some point after the more time-sensitive Windows AV support is completed.
Richard Gaskin
Community volunteer LiveCode Community Liaison

LiveCode development, training, and consulting services: Fourth World Systems: http://FourthWorld.com
LiveCode User Group on Facebook : http://FaceBook.com/groups/LiveCodeUsers/

MaxV
Posts: 1542
Joined: Tue May 28, 2013 2:20 pm
Location: Italy
Contact:

Re: Eureka... How to play a movie inside a stack on Lubuntu

Post by MaxV » Fri May 06, 2016 1:19 pm

It's important to change the file, becuase the Livecode video is buggy.
Livecode Wiki: http://livecode.wikia.com
My blog: http://livecodeitalia.blogspot.it
To post code use this: http://tinyurl.com/ogp6d5w

MaxV
Posts: 1542
Joined: Tue May 28, 2013 2:20 pm
Location: Italy
Contact:

Re: Eureka... How to play a movie inside a stack on Lubuntu

Post by MaxV » Fri May 06, 2016 1:35 pm

Livecode Wiki: http://livecode.wikia.com
My blog: http://livecodeitalia.blogspot.it
To post code use this: http://tinyurl.com/ogp6d5w

capellan
Posts: 527
Joined: Wed Aug 15, 2007 11:09 pm
Contact:

Re: Eureka... How to play a movie inside a stack on Lubuntu

Post by capellan » Mon Sep 19, 2016 7:30 pm

Hi MaxV,

Your instructions works fine in LC 7.1.4 on Linux
but crash LC 8.0.2
Have you test this video player using LC 8 series?

Post Reply

Return to “Linux”