156
155
xid = self.player.movie_window.get_window().get_xid()
157
156
imagesink.set_xwindow_id(xid)
158
157
Gdk.threads_leave()
161
def get_test_videoplayer_window():
163
# youtube example fragment
164
html_youtube = """<iframe width="640" height="390"
165
src="http://www.youtube.com/embed/h3oBU0NZJuA" frameborder="0"
166
allowfullscreen></iframe>"""
167
# vimeo example video fragment
168
html_vimeo = """<iframe
169
src="http://player.vimeo.com/video/2891554?title=0&byline=0&portrait=0"
170
width="400" height="308" frameborder="0" webkitAllowFullScreen
171
allowFullScreen></iframe><p><a href="http://vimeo.com/2891554">
172
Supertuxkart 0.6</a> from <a href="http://vimeo.com/user1183699">
173
constantin pelikan</a> on <a href="http://vimeo.com">Vimeo</a>.</p>"""
174
# dailymotion example video fragment
175
html_dailymotion = """<iframe frameborder="0" width="480" height="270"
176
src="http://www.dailymotion.com/embed/video/xm4ysu"></iframe>"""
177
html_dailymotion2 = """<iframe frameborder="0" width="480" height="379"
178
src="http://www.dailymotion.com/embed/video/xdiktp"></iframe>"""
180
html_youtube # pyflakes
181
html_dailymotion # pyflakes
182
html_dailymotion2 # pyflakes
184
win = Gtk.Window.new(Gtk.WindowType.TOPLEVEL)
185
win.set_default_size(500, 400)
186
win.connect("destroy", Gtk.main_quit)
187
player = VideoPlayer()
189
if len(sys.argv) < 2:
190
#player.uri = "http://upload.wikimedia.org/wikipedia/commons/9/9b/" \
191
# "Pentagon_News_Sample.ogg"
192
#player.uri = "http://people.canonical.com/~mvo/totem.html"
193
player.load_html_string(html_vimeo)
195
player.uri = sys.argv[1]
199
if __name__ == "__main__":
200
logging.basicConfig()
204
win = get_test_videoplayer_window()