Closed Bug 790777 Opened 12 years ago Closed 12 years ago

Can not play videos from IndexedDB

Categories

(Core :: Audio/Video, defect)

x86
Linux
defect
Not set
normal

Tracking

()

RESOLVED INVALID
blocking-basecamp +

People

(Reporter: JStagner, Assigned: vlad)

Details

(Whiteboard: [LOE:S])

Demo code for the problem can be downloaded here: 

http://www.misfitgeek.com/downloads/webm.zip

Or you can run the demo directly here:

http://www.misfitgeek.com/demo/webm/

To run the demo, click each of the 3 buttons from top to bottom. 

Each button will produce a finished message next top the button and the first button may take more than 30 seconds to complete depending on the speed of your internet connection.

The first button uses XHR to download a file into memory.
The second button takes that file from memory and stores it as a blob in an IndexedDB database.
The third button retrieves the file from IndexedDB and tries to play that video in a <video> element. 

Note from the trace that the mime type of the retrieved is reported as correct and the <video> element uses an explicit mime type but the video player still reports an unknown mime type.

The media file plays without error when served directly from a web server. 

I've tried webm and mpeg files with the same results (Windows and Linux, Release and Nightly)
I get the following when following in the web console you steps, on today's nightly:

[15:32:23.230] NS_ERROR_INVALID_POINTER: Component returned failure code: 0x80004003 (NS_ERROR_INVALID_POINTER) [nsIDOMMozURLProperty.createObjectURL] @ http://www.misfitgeek.com/demo/webm/js/page.js:88
Hi Paul, 

Not sure  I just ran it from the url again and it still works as expected for me.

As an alternative you can download the zip file and run it from a local server.
Interesting, I know works, just by reloading the page. Don't know what happened.
bent: is this a bug, or is there an error in the testcase?

cjones: assuming there's a bug here, should this block basecamp?

mbest: does this bug need to block the games effort?
blocking-basecamp: --- → ?
Summary: Can not play videos "in memory" → Can not play videos from IndexedDB
blocking-basecamp: ? → +
Assignee: nobody → bent.mozilla
I am not aware of any current attempts to use video on games targeted at mobile in this way.  Let me get Vlad to double check this but currently I would not put this blocking games or as a priority for games.  Games do use video for intro screens often but tend to use 2D placeholders or flash like animations when targeting mobile.
(In reply to Martin Best (:mbest) from comment #5)
> I am not aware of any current attempts to use video on games targeted at
> mobile in this way.  Let me get Vlad to double check this but currently I
> would not put this blocking games or as a priority for games.  Games do use
> video for intro screens often but tend to use 2D placeholders or flash like
> animations when targeting mobile.

Based on Martin's comments, it looks like this doesn't block games (which I believe is the reason this bug was marked as a basecamp blocker).

Also, did we verify whether this is a real bug or an error in the testcase?
blocking-basecamp: + → ?
We originally blocked based on apps in general playing locally-stored videos (in IDB).  Of course, the main use case we considered was games :)  That being said, it still seems important so re-+ing.
blocking-basecamp: ? → +
(In reply to Andrew Overholt [:overholt] from comment #7)
> We originally blocked based on apps in general playing locally-stored videos
> (in IDB).  Of course, the main use case we considered was games :)  That
> being said, it still seems important so re-+ing.

Fair enough.  Have we had a chance to verify if this is a real bug (or an error in the testcase)?
No, I haven't had a chance to look yet (rushing to meet feature freeze).
I think this is invalid -- the testcase is doing this:

get.onsuccess = function (event) {
  var videoFile = event.target.result;

  var videoURL = URL.createObjectURL(videoFile)

  document.getElementById("videoElement").setAttribute("src", videoURL);

  URL.revokeObjectURL(videoURL);
};

The load of the video is asynchronous, but the revokeObjectURL is synchronous in the onsuccess handler -- by the time the video element actually ties to open a channel to load, the URL has been revoked.  If I comment out the revokeObjectURL, things work fine.
(Stealing this from bent and -> INVALID -- reopen if anyone disagrees :)
Assignee: bent.mozilla → vladimir
Status: NEW → RESOLVED
Closed: 12 years ago
Resolution: --- → INVALID
You need to log in before you can comment on or make changes to this bug.