Skip to content

Instantly share code, notes, and snippets.

@mattdangerw
Created March 7, 2014 03:47
Show Gist options
  • Save mattdangerw/9404925 to your computer and use it in GitHub Desktop.
Save mattdangerw/9404925 to your computer and use it in GitHub Desktop.
Video playback crash
const Gtk = imports.gi.Gtk;
const Gdk = imports.gi.Gdk;
const System = imports.system;
const WebKit2 = imports.gi.WebKit2;
let html = '\n\
<!doctype html>\n\
<html>\n\
<body>\n\
<div id="player">\n\
<iframe id="player" type="text/html" width="854" height="480" src="http://www.youtube.com/embed/wZZ7oFKsKzY?enablejsapi=1&amp;autoplay=1&amp;origin=http://endlessm.com&amp;showinfo=0" frameborder="0" style="visibility:hidden;" onload="this.style.visibility=\'visible\';"></iframe>\n\
</div>\n\
</body>\n\
</html>\n\
\n';
Gtk.init(null, 0);
let web_view = new WebKit2.WebView();
web_view.load_html(html, null);
let test_window = new Gtk.Window({
default_width: 1000,
default_height: 600
});
test_window.add(web_view);
test_window.connect("destroy", Gtk.main_quit);
test_window.show_all();
test_window.connect("draw", function () {
print("hey");
});
Gtk.main();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment