Media Playback not working

Bug #1455371 reported by Justin McPherson
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Oxide
Fix Released
Critical
Chris Coulson
webbrowser-app
Invalid
Undecided
Unassigned

Bug Description

Playing videos does not work.

Using YouTube as an example - attempting to play video will fail. On screen, nothing will appear, in the console an error regarding URL dispatch will appear, example -
"""
** (process:15981): WARNING **: Unable to dispatch url 'rtsp://r8---sn-a5m7zu7e.googlevideo.com/ClULENy73wIaTAmquZp3BTDekxMYESARFC1BnVVVMOCoAUIJbXYtZ29vZ2xlSARSBXdhdGNoYPe869LklayhVYIBBWh0bWw1igELUFZKc3VnMmRDMHcM/A5D1BFB6642231A201ED6B20962C6B7448DFFD46.4A1950BCF2F8820AB30C7C53B15EB7BDC34F6BE9/yt5/1/video.3gp':GDBus.Error:com.canonical.URLDispatcher.BadURL: URL 'rtsp://r8---sn-a5m7zu7e.googlevideo.com/ClULENy73wIaTAmquZp3BTDekxMYESARFC1BnVVVMOCoAUIJbXYtZ29vZ2xlSARSBXdhdGNoYPe869LklayhVYIBBWh0bWw1igELUFZKc3VnMmRDMHcM/A5D1BFB6642231A201ED6B20962C6B7448DFFD46.4A1950BCF2F8820AB30C7C53B15EB7BDC34F6BE9/yt5/1/video.3gp' is not handleable by the URL Dispatcher
"""

Other video sites, (eg. vimeo, dailymotion) also fail, but with different effects.

Changed in oxide:
assignee: nobody → Justin McPherson (justinmcp)
Changed in oxide:
importance: Undecided → Critical
milestone: none → branch-1.8
Revision history for this message
Chris Coulson (chrisccoulson) wrote :

Youtube works for me in a plain webview on the phone, but not in the browser. That's a bit odd :/

Revision history for this message
Justin McPherson (justinmcp) wrote :

This appears to be two separate bugs -
1) There is a problem with User Agent overrides, the above error from YouTube appears to be a "hands in the air", not understanding the level of browser support and so throwing out an rtsp url.
2) There is a (as yet) unknown crash when attempting actual media playback - easily seen on dailymotion, which does not have the same detection logic as YT.

Revision history for this message
Chris Coulson (chrisccoulson) wrote :

I haven't seen the crash, but what bit of the user agent override fails? I tried looking at the outgoing HTTP headers and navigator.userAgent in the devtools console, and both are as expected

Revision history for this message
Chris Coulson (chrisccoulson) wrote :
Revision history for this message
Chris Coulson (chrisccoulson) wrote :
Revision history for this message
Chris Coulson (chrisccoulson) wrote :

It's neither of those 2

Revision history for this message
Chris Coulson (chrisccoulson) wrote :
Revision history for this message
Chris Coulson (chrisccoulson) wrote :

IIUC, it looks like the browser loads the UA overrides on the UI thread and then passes them as a property on a QObject to the worker script running on the IO thread:

http://bazaar.launchpad.net/~phablet-team/webbrowser-app/trunk/view/head:/src/Ubuntu/Web/UbuntuWebContext.qml#L41

... this would explain why http://bazaar.launchpad.net/~oxide-developers/oxide/oxide.trunk/revision/1041 breaks it, as passing QObjects in messages between threads is no longer allowed (and should never have been allowed really - it's fairly unsafe).

Olivier, is there a way to do that in the browser without using a QObject (ie, just using JSON)?

Changed in webbrowser-app:
assignee: nobody → Olivier Tilloy (osomon)
Revision history for this message
Chris Coulson (chrisccoulson) wrote :

Actually, I've misread that - it's not sending the QObject. Back to the drawing board

Changed in webbrowser-app:
assignee: Olivier Tilloy (osomon) → nobody
status: New → Invalid
Revision history for this message
Chris Coulson (chrisccoulson) wrote :

Oh, but the URL's are getting stripped from the data. If I printf("%s\n", qPrintable(doc.toJson())); in OxideQQuickWebContextDelegateWorker::sendMessage, then I see this:

{
    "overrides": [
        [
            null,
            "Mozilla/5.0 (Linux; Ubuntu 14.04 like Android 4.4) AppleWebKit/537.36 Chromium/35.0.1870.2 Mobile Safari"
        ],
        [
            null,
            "Mozilla/5.0 (Linux; Ubuntu 14.04 like Android 4.4;) AppleWebKit/537.36 Chromium/35.0.1870.2 Mobile Safari/537.36"
        ],
        [
            null,
            "Mozilla/5.0 (Linux; Ubuntu 14.04 like Android 4.4;) AppleWebKit/537.36 Chrome/35.0.1870.2 Mobile Safari/537.36"
        ],
        [
            null,
            "Mozilla/5.0 (Linux; Ubuntu 14.04 like Android 4.4;) AppleWebKit/537.36 Chrome/35.0.1870.2 Mobile Safari/537.36"
        ],
        [
            null,
            "Mozilla/5.0 (Linux; Ubuntu 14.04 like Android 4.4;) AppleWebKit/537.36 Chrome/35.0.1870.2 Mobile Safari/537.36"
        ]
    ]
}

Revision history for this message
Chris Coulson (chrisccoulson) wrote :

Aha, because the regular expressions are not valid JSON

Revision history for this message
Chris Coulson (chrisccoulson) wrote :

I've reverted bug 1445673

Changed in oxide:
assignee: Justin McPherson (justinmcp) → Chris Coulson (chrisccoulson)
status: New → Fix Released
Revision history for this message
Olivier Tilloy (osomon) wrote :

Chris: if that helps, we could probably encode regexps as strings before passing them around, and decoding them again on the other side (not tested, but this should work).

Revision history for this message
Chris Coulson (chrisccoulson) wrote :

Can you use the RegExp constructor on both sides? That should work.

Shall we take that discussion to bug 1445673? I'll add a webbrowser-app task there

Revision history for this message
Chris Coulson (chrisccoulson) wrote :

/both sides/the worker side/

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.