The time now is Wed 19 Jun 2013, 09:18
All times are UTC - 4 |
| Author |
Message |
sc0ttman

Joined: 16 Sep 2009 Posts: 2199 Location: UK
|
Posted: Fri 31 Aug 2012, 07:16 Post_subject:
How to embed VLC playback windows in Gtkdialog! Sub_title: (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
|
|
 |
sc0ttman

Joined: 16 Sep 2009 Posts: 2199 Location: UK
|
Posted: 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
|
|
 |
|
|
|
Rules_post_cannot Rules_reply_cannot Rules_edit_cannot Rules_delete_cannot Rules_vote_cannot You cannot attach files in this forum You can download files in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|
|
[ Time: 0.0386s ][ Queries: 12 (0.0050s) ][ GZIP on ] |