Puppy Linux Discussion Forum Forum Index Puppy Linux Discussion Forum
Puppy HOME page : puppylinux.com
"THE" alternative forum : puppylinux.info
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

The time now is Wed 22 May 2013, 18:40
All times are UTC - 4
 Forum index » House Training » HOWTO ( Solutions )
How to embed VLC playback windows in Gtkdialog!
Moderators: Flash, Ian, JohnMurga
Post new topic   Reply to topic View previous topic :: View next topic
Page 1 of 1 [2 Posts]  
Author Message
sc0ttman


Joined: 16 Sep 2009
Posts: 2174
Location: UK

PostPosted: Fri 31 Aug 2012, 07:16    Post subject:  How to embed VLC playback windows in Gtkdialog!
Subject description: (or embed VLC in other windows, generally...)
 

You can use the --drawable-xid option in VLC to embed it into other windows...

You just need to give the window ID, which you get using 'xwininfo'.

Here is an example script 'vlc_embed'. It embeds playback of the given into a gtkdialog window:

Code:
#!/bin/bash

# save this code as vlc_embed

gtkdialog -s <<< '<window title="VLC Playback" width-request="640" height-request="480">
<vbox>
<button><action>killall vlc</action><action type="exit">EXIT_NOW</action></button>
</vbox>
</window>' &
sleep 2

OSC_WID="$(xwininfo -name "VLC Playback" | grep -m1 'Window id: ' | cut -f4 -d' ')"

vlc -I dummy --drawable-xid  $OSC_WID "$@" &

exit 0


Usage of the above:

vlc_embed /path/to/file.avi

EDIT: No idea how to send playback control to VLC once its embedded thoough...

If anyone knows how I can send play/stop/next/prev/fullscreen/etc commands to VLC when it's embedded, I will be VERY grateful!

_________________
Akita Linux, VLC-GTK, Pup Search, Pup File Search
Back to top
View user's profile Send private message 
sc0ttman


Joined: 16 Sep 2009
Posts: 2174
Location: UK

PostPosted: Sat 01 Sep 2012, 07:03    Post subject:  

Here is how you add controls:

Essentially, use this option with vlc:

--extraintf rc --rc-host localhost:123

VLC will then listen on localhost:123 for commands...

Then you can send the VLC commands to localhost:123, like so:

echo pause | nc localhost 123

(where 'pause' is any valid VLC playback command)

Here is a simple script, save it as 'vlc_embed', make it exec, and run like so:

./vlc_embed "path/to/file"

Code:
#!/bin/bash

gtkdialog -s <<< '<window title="VLC Controls" width-request="600" height-request="450">
<vbox>
<button><label>Play/Stop</label><action>echo pause | nc localhost 123</action></button>
<button><label>Quit</label><action>echo quit | nc localhost 123</action><action type="exit">EXIT_NOW</action></button>
</vbox>
</window>' &
sleep 1

OSC_WID="$(xwininfo -name "VLC Controls" | grep -m1 'Window id: ' | cut -f4 -d' ')"
echo OSC_WID = $OSC_WID
export OSC_WID
vlc --extraintf rc --rc-host localhost:123 --drawable-xid  $OSC_WID "$@"
exit 0

_________________
Akita Linux, VLC-GTK, Pup Search, Pup File Search
Back to top
View user's profile Send private message 
Display posts from previous:   Sort by:   
Page 1 of 1 [2 Posts]  
Post new topic   Reply to topic View previous topic :: View next topic
 Forum index » House Training » HOWTO ( Solutions )
Jump to:  

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group
[ Time: 0.0443s ][ Queries: 11 (0.0100s) ][ GZIP on ]