Open
Bug 896371
Opened 11 years ago
Updated 2 years ago
Media Recording - Can't record the mediaStream from audio tag with src=local file
Categories
(Core :: Audio/Video: Recording, defect, P3)
Tracking
()
NEW
People
(Reporter: rlin, Unassigned)
Details
Attachments
(1 file)
(deleted),
text/html
|
Details |
Found the principle check should be equal.
nsPrincipal::Subsumes(nsIPrincipal *aOther, bool *aResult)
{
return Equals(aOther, aResult);
}
The mediaStream's principal has the "file" targetScheme and MediaRecorder's document's principal fail to subsumes with the mediaStream's principal.
Reporter | ||
Comment 1•11 years ago
|
||
What is this bug about? I don't understand.
Reporter | ||
Comment 3•11 years ago
|
||
I try to record the mediastream which come from an audio tag, if the src is a file, I found the principal check is failed. Seems it can't compare with two different schema.
http: URLs aren't same-origin with file: URLs, if that's what you mean.
The example in comment #1 works I think, since the page and the OGG file are both http URLs.
Updated•11 years ago
|
Blocks: MediaRecording
Reporter | ||
Comment 5•11 years ago
|
||
roc, you are right.
This problem happen on open the local html file and do the record function.
So that cause this problem.
Summary: Media Recording - Can't record the mediaStream from audio tag with src=file → Media Recording - Can't record the mediaStream from audio tag with src=local file
I'm not sure if this is a real bug, but even if it is, it's not very important since file URLs are not very much used.
Reporter | ||
Comment 7•11 years ago
|
||
Hi roc,
But the test case will failed due to this problem..
Comment 8•11 years ago
|
||
(In reply to Robert O'Callahan (:roc) (Mozilla Corporation) from comment #6)
> I'm not sure if this is a real bug, but even if it is, it's not very
> important since file URLs are not very much used.
The mochitests in content/media however rely on file:/// protocol URLs however on desktop. So this bug will become a problem in mochitests. However, The other option we could do here is to workaround the problem in manifest.js similar to what's done on Android and B2G to avoid file:/// protocol URLs for media recorder mochitests.
Reference:
http://mxr.mozilla.org/mozilla-central/source/content/media/test/manifest.js#217
Reporter | ||
Updated•11 years ago
|
Assignee: nobody → rlin
Only gInfoLeakTests uses fileUriToSrc, and gInfoLeakTests has nothing to do with Media Recorder. So I don't see what test case is going to fail.
Comment 10•11 years ago
|
||
(In reply to Robert O'Callahan (:roc) (Mozilla Corporation) from comment #9)
> Only gInfoLeakTests uses fileUriToSrc, and gInfoLeakTests has nothing to do
> with Media Recorder. So I don't see what test case is going to fail.
Ah you are right. Hmm...well, apparently this is going to fail with a mochitest URL loaded over HTTP. I just modified my patch on the blocking bug to directly load the opus resource over HTTP and I still get this security error.
https://tbpl.mozilla.org/?tree=Try&rev=fd385252fac9
https://hg.mozilla.org/try/rev/fd385252fac9#l2.27
So the open question here is why are we getting a security error when loading a media resource over HTTP as well?
Reporter | ||
Comment 12•11 years ago
|
||
Use this kind of format shouldn't be blocked.
2.27 + var baseURL = 'http://mochi.test:8888/tests/content/media/test/';
2.29 + element.src = baseURL + test.name;
I will check it.
Reporter | ||
Comment 13•11 years ago
|
||
That securityError cause by the principal object is created by the decoder object and MediaRecorder will use it to check if this UA can record this object. So the mediaRecorder start should wait the audio element's decoder ready.
Maybe hook the ready event(or others one?) on audio tag then start test is better than my method.
Comment 14•11 years ago
|
||
(In reply to Randy Lin [:rlin] from comment #13)
> Created attachment 783236 [details]
> test_mediarecorder_recordnotimeslice.html
>
> That securityError cause by the principal object is created by the decoder
> object and MediaRecorder will use it to check if this UA can record this
> object. So the mediaRecorder start should wait the audio element's decoder
> ready.
>
> Maybe hook the ready event(or others one?) on audio tag then start test is
> better than my method.
Ah ha. That makes sense. Probably need to wait until canplaythrough fires then before calling start on the media recorder object.
Comment 15•11 years ago
|
||
(In reply to Robert O'Callahan (:roc) (Mozilla Corporation) from comment #6)
> I'm not sure if this is a real bug, but even if it is, it's not very
> important since file URLs are not very much used.
It looks like web apps installed on b2g use file URLs too. For that case, it will stop web apps from working on b2g.
Comment 16•11 years ago
|
||
(In reply to jwwang from comment #15)
> (In reply to Robert O'Callahan (:roc) (Mozilla Corporation) from comment #6)
> > I'm not sure if this is a real bug, but even if it is, it's not very
> > important since file URLs are not very much used.
>
> It looks like web apps installed on b2g use file URLs too. For that case, it
> will stop web apps from working on b2g.
So the device storage use case could be potentially be impacted then, right?
Comment 17•11 years ago
|
||
This might even impact packaged apps generally. I'm putting needinfo on myself to test this in a packaged app. If it does, then probably needs a blocker for release.
Flags: needinfo?(jsmith)
Comment 18•11 years ago
|
||
(In reply to Jason Smith [:jsmith] from comment #17)
> This might even impact packaged apps generally. I'm putting needinfo on
> myself to test this in a packaged app. If it does, then probably needs a
> blocker for release.
This appears to work fine for me in a packaged app I created here:
http://mozilla.github.io/qa-testcase-data/webapi/mediarecorder/mediaRecorder.zip
I'm not seeing the error seen in this bug in a packaged app making use of an opus file local to the packaged app.
Flags: needinfo?(jsmith)
Comment 19•11 years ago
|
||
It looks like packaged app will use app:// scheme instead of file://. So it won't have the same-origin problem as local files.
Updated•11 years ago
|
Component: Video/Audio → Video/Audio: Recording
Updated•11 years ago
|
No longer blocks: MediaRecording
Updated•9 years ago
|
Rank: 25
Priority: -- → P2
Comment 21•7 years ago
|
||
Mass change P2->P3 to align with new Mozilla triage process.
Priority: P2 → P3
Updated•2 years ago
|
Severity: normal → S3
You need to log in
before you can comment on or make changes to this bug.
Description
•