[Webkit-unassigned] [Bug 140808] [GTK] .ogv videos over http cannot seek using video controls
bugzilla-daemon at webkit.org
bugzilla-daemon at webkit.org
Thu Aug 6 11:36:57 PDT 2015
https://bugs.webkit.org/show_bug.cgi?id=140808
--- Comment #8 from Philip Chimento <philip.chimento at gmail.com> ---
(In reply to comment #7)
> It is also interesting that the crash happens in JS without any trace of
> going into GStreamer, or am I missing anything?
I think the crash may only have been in that particular development snapshot.
(In reply to comment #6)
> Well it depends how the pipeline retrieves data from the source, there are 2
> modes, push and pull. By local source you mean file:///? In that
> configuration push mode is selected (I think) and filesrc has a complete
> access to the data, and then seeking is easy. But for an http:// source,
> where we can't randomly access data easily, we work in pull mode and that's
> a bit more complicated.
How about blob URIs? I also have a sample program that loads a local file using XHR and sets the <video>'s src attribute to a blob URI. This also doesn't seek when playing OGV.
import gi
gi.require_version('WebKit2', '4.0')
from gi.repository import GLib, Gio, Gtk, WebKit2
def _handle_local_uri(request, data=None):
path = request.get_path()
f = Gio.File.new_for_path(path)
try:
stream = f.read(None)
request.finish(stream, -1, 'text/html')
except GLib.Error as e:
request.finish_error(e)
context = WebKit2.WebContext.get_default()
security = context.get_security_manager()
context.register_uri_scheme('local', _handle_local_uri, None)
security.register_uri_scheme_as_cors_enabled('local')
w = Gtk.Window(default_width=700, default_height=500)
v = WebKit2.WebView()
w.add(v)
w.connect('destroy', Gtk.main_quit)
v.get_settings().props.enable_developer_extras = True
# Comment the following line out to break playing the video at all!
v.get_inspector().show()
v.load_html('''
<!DOCTYPE html>
<html>
<head>
<script type="text/javascript">
window.onload = function() {
var elem = document.getElementById("video-player");
var req = new XMLHttpRequest();
req.onload = function () {
var blob_uri = URL.createObjectURL(this.response);
var source = document.createElement("source");
elem.appendChild(source);
source.src = blob_uri;
};
req.responseType = "blob";
req.open("GET", "video.ogv");
req.send(null);
};
</script>
</head>
<body>
<video autoplay controls width="400" height="300" id="video-player"></video>
</body>
</html>
''', 'local:///home/philip/checkout/scratch/')
w.show_all()
Gtk.main()
--
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.webkit.org/pipermail/webkit-unassigned/attachments/20150806/1fd28b8b/attachment-0001.html>
More information about the webkit-unassigned
mailing list