easy_mplayer 1.2.0 → 1.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/VERSION +1 -1
- data/easy_mplayer.gemspec +1 -1
- data/lib/easy_mplayer/main.rb +8 -1
- data/lib/easy_mplayer/worker.rb +2 -2
- metadata +1 -1
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
1.2.
|
1
|
+
1.2.1
|
data/easy_mplayer.gemspec
CHANGED
data/lib/easy_mplayer/main.rb
CHANGED
@@ -85,7 +85,7 @@ class MPlayer
|
|
85
85
|
|
86
86
|
callback :file_error do
|
87
87
|
warn "File error!"
|
88
|
-
stop
|
88
|
+
stop
|
89
89
|
end
|
90
90
|
|
91
91
|
callback :startup do
|
@@ -116,6 +116,13 @@ class MPlayer
|
|
116
116
|
def path=(val)
|
117
117
|
@opts[:path] = val
|
118
118
|
end
|
119
|
+
|
120
|
+
# takes a block, that should return the X11 window_id of a window
|
121
|
+
# that mplayer can use as a render target. This will cause mplayer
|
122
|
+
# to embed its output into that window, as if it was a native widget.
|
123
|
+
def embed(&block)
|
124
|
+
@opts[:embed] = block
|
125
|
+
end
|
119
126
|
|
120
127
|
# can be any of:
|
121
128
|
# :quiet Supperss all output!
|
data/lib/easy_mplayer/worker.rb
CHANGED
@@ -222,9 +222,9 @@ class MPlayer
|
|
222
222
|
|
223
223
|
def cmdline(target = parent.opts[:path])
|
224
224
|
cmd = "#{parent.opts[:program]} -slave "
|
225
|
-
cmd += "-wid #{parent.opts[:embed]} " if parent.opts[:embed]
|
225
|
+
cmd += "-wid #{parent.opts[:embed].call} " if parent.opts[:embed]
|
226
226
|
cmd += "-playlist " if target=~ /\.m3u$/
|
227
|
-
cmd += target.to_s
|
227
|
+
cmd += '"' + target.to_s + '"'
|
228
228
|
end
|
229
229
|
|
230
230
|
def lock!
|