{{APIRef("WebRTC")}}
The active
read-only property of the {{domxref("MediaStream")}} interface returns a Boolean value that will return to be true
if the MediaStream is active, else false
.
Syntax
var isActive = MediaStream.active;
Value
A Boolean value that returns true
if the MediaStream is active, or false
otherwise.
Example
var promise = navigator.mediaDevices.getUserMedia({ audio: true, video: true }); promise.then(function(stream) { var startBtn = document.querySelector('#startBtn'); startBtn.disabled = stream.active; };)
Specifications
Specification | Status | Comment |
---|---|---|
{{SpecName('Media Capture', '#widl-MediaStream-active', 'active')}} | {{Spec2('Media Capture')}} | Initial definition. |
Browser compatibility
{{CompatibilityTable}}
Feature | Chrome | Firefox (Gecko) | Internet Explorer | Opera | Safari (WebKit) |
---|---|---|---|---|---|
Basic support | {{CompatVersionUnknown}} | {{CompatUnknown}} | {{CompatUnknown}} | {{CompatUnknown}} | {{CompatUnknown}} |
Feature | Android | Android Webview | Firefox Mobile (Gecko) | Firefox OS | IE Mobile | Opera Mobile | Safari Mobile | Chrome for Android |
---|---|---|---|---|---|---|---|---|
Basic support | {{CompatNo}} | {{CompatVersionUnknown}} | {{CompatUnknown}} | {{CompatUnknown}} | {{CompatUnknown}} | {{CompatUnknown}} | {{CompatUnknown}} | {{CompatVersionUnknown}} |