Closed Bug 798037 Opened 12 years ago Closed 12 years ago

There is no way to release the local device (e.g. video, audio) aquired via mozGetUserMedia() through the LocalMediaStream object

Categories

(Core :: WebRTC: Audio/Video, defect)

18 Branch
defect
Not set
normal

Tracking

()

RESOLVED DUPLICATE of bug 803976

People

(Reporter: whimboo, Unassigned)

Details

(Whiteboard: [getUserMedia], [blocking-gum+])

Attachments

(1 file)

Right now it's not possible to release the local device (e.g. camera) once the code below has been ran:

    navigator.mozGetUserMedia({video:true}, function (stream) {
      // Will fail because we do not return a LocalMediaStream
      stream.stop();
    }

It also applies to all other types of media.

I will attach a Mochitest which should be checked-in together with the patch in a bit.
Whiteboard: [getUserMedia]
Summary: There is no way to release the camera aquired via mozGetUserMedia() → There is no way to release the local device (e.g. camera) aquired via mozGetUserMedia()
Whiteboard: [getUserMedia]
Whiteboard: [getUserMedia]
Attached file Possible Mochitest
This is a potential Mochitest for this specific bug. I'm not sure which interface Randell was referring to on IRC so I haven't implemented a specific check here yet.

Anant, can you please give feedback in how this bug can be solved?
Summary: There is no way to release the local device (e.g. camera) aquired via mozGetUserMedia() → There is no way to release the local device (e.g. video, audio) aquired via mozGetUserMedia()
In your code snippet, the stream isn't actually assigned anywhere, so the camera should not turn on. Is that not the case?

In order to release the local device, just de-assign the stream from any active <video>/<audio> element. We should support stop() too, of course, but don't currently.
(In reply to Anant Narayanan [:anant] from comment #2)
> In your code snippet, the stream isn't actually assigned anywhere, so the
> camera should not turn on. Is that not the case?

Right, that's what I see here. The green LED on my MBP gets green.

> In order to release the local device, just de-assign the stream from any
> active <video>/<audio> element. We should support stop() too, of course, but
> don't currently.

So probably we have two issues here?
Yes, sounds like we have 2 bugs that need to be addressed.
I recall there was already a bug open about the camera turning on early, Jason?
(In reply to Anant Narayanan [:anant] from comment #5)
> I recall there was already a bug open about the camera turning on early,
> Jason?

Bug 782191.
Whiteboard: [getUserMedia] → [getUserMedia], [blocking-gum+]
Flags: in-testsuite?
Blocks: 773646
Updating title. It is technically possible to release the local device if you add and remove the stream from a HTMLMediaElement, although that's a different bug. The real issue here is that you can't do it through the stream object.
Summary: There is no way to release the local device (e.g. video, audio) aquired via mozGetUserMedia() → There is no way to release the local device (e.g. video, audio) aquired via mozGetUserMedia() through the MediaStream object
No longer blocks: 773646
Summary: There is no way to release the local device (e.g. video, audio) aquired via mozGetUserMedia() through the MediaStream object → There is no way to release the local device (e.g. video, audio) aquired via mozGetUserMedia() through the LocalMediaStream object
Not sure why bug 803976 has been filed separately but I would suggest to keep that open for a specific mochitest. If you disagree we can also take bug 803976 for it.
Depends on: 803976
This will be fixed by bug 803976. I'm duping on that bug.
Status: NEW → RESOLVED
Closed: 12 years ago
No longer depends on: 803976
Flags: in-testsuite?
Resolution: --- → DUPLICATE
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: