Bug 1258143 - Remove LocalMediaStream. r=jib,smaug

Differential Revision: https://phabricator.services.mozilla.com/D8064

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Andreas Pehrson 2018-10-11 12:43:34 +00:00
Родитель f5f6f6fdb4
Коммит ecdb48777f
43 изменённых файлов: 54 добавлений и 467 удалений

Просмотреть файл

@ -507,11 +507,6 @@ DOMInterfaces = {
'wrapperCache': False,
},
'LocalMediaStream': {
'headerFile': 'DOMMediaStream.h',
'nativeType': 'mozilla::DOMLocalMediaStream'
},
'MatchGlob': {
'nativeType': 'mozilla::extensions::MatchGlob',
},

Просмотреть файл

@ -18,7 +18,6 @@
#include "mozilla/dom/AudioTrackList.h"
#include "mozilla/dom/DocGroup.h"
#include "mozilla/dom/HTMLCanvasElement.h"
#include "mozilla/dom/LocalMediaStreamBinding.h"
#include "mozilla/dom/MediaStreamBinding.h"
#include "mozilla/dom/MediaStreamTrackEvent.h"
#include "mozilla/dom/Promise.h"
@ -404,13 +403,6 @@ NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(DOMMediaStream)
NS_INTERFACE_MAP_ENTRY(DOMMediaStream)
NS_INTERFACE_MAP_END_INHERITING(DOMEventTargetHelper)
NS_IMPL_ADDREF_INHERITED(DOMLocalMediaStream, DOMMediaStream)
NS_IMPL_RELEASE_INHERITED(DOMLocalMediaStream, DOMMediaStream)
NS_INTERFACE_MAP_BEGIN(DOMLocalMediaStream)
NS_INTERFACE_MAP_ENTRY(DOMLocalMediaStream)
NS_INTERFACE_MAP_END_INHERITING(DOMMediaStream)
NS_IMPL_CYCLE_COLLECTION_INHERITED(DOMAudioNodeMediaStream, DOMMediaStream,
mStreamNode)
@ -1533,65 +1525,6 @@ DOMMediaStream::NotifyPlaybackTrackBlocked()
}
}
DOMLocalMediaStream::~DOMLocalMediaStream()
{
if (mInputStream) {
// Make sure Listeners of this stream know it's going away
StopImpl();
}
}
JSObject*
DOMLocalMediaStream::WrapObject(JSContext* aCx, JS::Handle<JSObject*> aGivenProto)
{
return dom::LocalMediaStream_Binding::Wrap(aCx, this, aGivenProto);
}
void
DOMLocalMediaStream::Stop()
{
LOG(LogLevel::Debug, ("DOMMediaStream %p Stop()", this));
nsCOMPtr<nsPIDOMWindowInner> pWindow = GetParentObject();
nsIDocument* document = pWindow ? pWindow->GetExtantDoc() : nullptr;
nsContentUtils::ReportToConsole(nsIScriptError::warningFlag,
NS_LITERAL_CSTRING("Media"),
document,
nsContentUtils::eDOM_PROPERTIES,
"MediaStreamStopDeprecatedWarning");
StopImpl();
}
void
DOMLocalMediaStream::StopImpl()
{
if (mInputStream && mInputStream->AsSourceStream()) {
mInputStream->AsSourceStream()->EndAllTrackAndFinish();
}
}
already_AddRefed<DOMLocalMediaStream>
DOMLocalMediaStream::CreateSourceStreamAsInput(nsPIDOMWindowInner* aWindow,
MediaStreamGraph* aGraph,
MediaStreamTrackSourceGetter* aTrackSourceGetter)
{
RefPtr<DOMLocalMediaStream> stream =
new DOMLocalMediaStream(aWindow, aTrackSourceGetter);
stream->InitSourceStream(aGraph);
return stream.forget();
}
already_AddRefed<DOMLocalMediaStream>
DOMLocalMediaStream::CreateTrackUnionStreamAsInput(nsPIDOMWindowInner* aWindow,
MediaStreamGraph* aGraph,
MediaStreamTrackSourceGetter* aTrackSourceGetter)
{
RefPtr<DOMLocalMediaStream> stream =
new DOMLocalMediaStream(aWindow, aTrackSourceGetter);
stream->InitTrackUnionStream(aGraph);
return stream.forget();
}
DOMAudioNodeMediaStream::DOMAudioNodeMediaStream(nsPIDOMWindowInner* aWindow, AudioNode* aNode)
: DOMMediaStream(aWindow, nullptr),
mStreamNode(aNode)

Просмотреть файл

@ -28,7 +28,6 @@
namespace mozilla {
class AbstractThread;
class DOMLocalMediaStream;
class DOMMediaStream;
class MediaStream;
class MediaInputPort;
@ -206,7 +205,6 @@ class DOMMediaStream : public DOMEventTargetHelper,
public dom::PrincipalChangeObserver<dom::MediaStreamTrack>,
public RelativeTimeline
{
friend class DOMLocalMediaStream;
friend class dom::MediaStreamTrack;
typedef dom::MediaStreamTrack MediaStreamTrack;
typedef dom::AudioStreamTrack AudioStreamTrack;
@ -756,49 +754,6 @@ private:
NS_DEFINE_STATIC_IID_ACCESSOR(DOMMediaStream,
NS_DOMMEDIASTREAM_IID)
#define NS_DOMLOCALMEDIASTREAM_IID \
{ 0xb1437260, 0xec61, 0x4dfa, \
{ 0x92, 0x54, 0x04, 0x44, 0xe2, 0xb5, 0x94, 0x9c } }
class DOMLocalMediaStream : public DOMMediaStream
{
public:
explicit DOMLocalMediaStream(nsPIDOMWindowInner* aWindow,
MediaStreamTrackSourceGetter* aTrackSourceGetter)
: DOMMediaStream(aWindow, aTrackSourceGetter) {}
NS_DECL_ISUPPORTS_INHERITED
NS_DECLARE_STATIC_IID_ACCESSOR(NS_DOMLOCALMEDIASTREAM_IID)
virtual JSObject* WrapObject(JSContext* aCx, JS::Handle<JSObject*> aGivenProto) override;
void Stop();
/**
* Create an nsDOMLocalMediaStream whose underlying stream is a SourceMediaStream.
*/
static already_AddRefed<DOMLocalMediaStream>
CreateSourceStreamAsInput(nsPIDOMWindowInner* aWindow,
MediaStreamGraph* aGraph,
MediaStreamTrackSourceGetter* aTrackSourceGetter = nullptr);
/**
* Create an nsDOMLocalMediaStream whose underlying stream is a TrackUnionStream.
*/
static already_AddRefed<DOMLocalMediaStream>
CreateTrackUnionStreamAsInput(nsPIDOMWindowInner* aWindow,
MediaStreamGraph* aGraph,
MediaStreamTrackSourceGetter* aTrackSourceGetter = nullptr);
protected:
virtual ~DOMLocalMediaStream();
void StopImpl();
};
NS_DEFINE_STATIC_IID_ACCESSOR(DOMLocalMediaStream,
NS_DOMLOCALMEDIASTREAM_IID)
class DOMAudioNodeMediaStream : public DOMMediaStream
{
typedef dom::AudioNode AudioNode;

Просмотреть файл

@ -1520,8 +1520,8 @@ public:
// fake tracks. Apart from them gUM never adds tracks dynamically.
domStream = new nsMainThreadPtrHolder<DOMMediaStream>(
"GetUserMediaStreamRunnable::DOMMediaStreamMainThreadHolder",
DOMLocalMediaStream::CreateSourceStreamAsInput(window, msg,
new FakeTrackSourceGetter(principal)));
DOMMediaStream::CreateSourceStreamAsInput(window, msg,
new FakeTrackSourceGetter(principal)));
stream = domStream->GetInputStream()->AsSourceStream();
if (mAudioDevice) {

Просмотреть файл

@ -825,8 +825,8 @@ public:
void RemoveAllDirectListenersImpl() override;
/**
* End all tracks and Finish() this stream. Used to voluntarily revoke access
* to a LocalMediaStream.
* End all tracks and Finish() this stream. Used to voluntarily revoke access
* to a MediaStream.
*/
void EndAllTrackAndFinish();

Просмотреть файл

@ -21,7 +21,7 @@ public:
, mIsWritingComplete(false)
{}
virtual ~ContainerWriter() {}
// Mapping to DOMLocalMediaStream::TrackTypeHints
// Mapping to DOMMediaStream::TrackTypeHints
enum {
CREATE_AUDIO_TRACK = 1 << 0,
CREATE_VIDEO_TRACK = 1 << 1,

Просмотреть файл

@ -27,7 +27,7 @@ interface nsIDOMGetUserMediaSuccessCallback : nsISupports
{
/*
* value must be a Blob if picture is true and a
* DOMLocalMediaStream if either audio or video are true.
* DOMMediaStream if either audio or video are true.
*/
void onSuccess(in nsISupports value);
};

Просмотреть файл

@ -30,8 +30,8 @@ async function startTest() {
// no more requestData() to prevent busy main thread from starving
// the encoding thread
if (count == 30) {
info("stream.stop");
stream.stop();
info("track.stop");
stream.getTracks()[0].stop();
} else if (count < 30 && mediaRecorder.state == 'recording') {
info("requestData again");
mediaRecorder.requestData();

Просмотреть файл

@ -131,7 +131,7 @@ async function startTest() {
checkTrackChanged(1, false);
} else if (steps == 3) {
checkTrackChanged(2, true);
stream.stop();
stream.getTracks().forEach(t => t.stop());
}
}

Просмотреть файл

@ -105,7 +105,7 @@ async function startTest() {
element.onpause = onpause;
element.pause();
} else if (steps == 2) {
stream.stop();
stream.getTracks().forEach(t => t.stop());
}
}

Просмотреть файл

@ -143,76 +143,6 @@ MediaStreamPlayback.prototype = {
}
}
/**
* This class is basically the same as MediaStreamPlayback except
* ensures that the instance provided startMedia is a MediaStream.
*
* @param {HTMLMediaElement} mediaElement the media element for playback
* @param {LocalMediaStream} mediaStream the media stream used in
* the mediaElement for playback
*/
function LocalMediaStreamPlayback(mediaElement, mediaStream) {
ok(mediaStream instanceof LocalMediaStream,
"Stream should be a LocalMediaStream");
MediaStreamPlayback.call(this, mediaElement, mediaStream);
}
LocalMediaStreamPlayback.prototype = Object.create(MediaStreamPlayback.prototype, {
/**
* DEPRECATED - MediaStream.stop() is going away. Use MediaStreamTrack.stop()!
*
* Starts media with a media stream, runs it until a canplaythrough and
* timeupdate event fires, and calls stop() on the stream.
*
* @param {Boolean} isResume specifies if this media element is being resumed
* from a previous run
*/
playMediaWithDeprecatedStreamStop : {
value: function(isResume) {
this.startMedia(isResume);
return this.verifyPlaying()
.then(() => this.deprecatedStopStreamInMediaPlayback())
.then(() => this.detachFromMediaElement());
}
},
/**
* DEPRECATED - MediaStream.stop() is going away. Use MediaStreamTrack.stop()!
*
* Stops the local media stream while it's currently in playback in
* a media element.
*
* Precondition: The media stream and element should both be actively
* being played.
*
*/
deprecatedStopStreamInMediaPlayback : {
value: function () {
return new Promise((resolve, reject) => {
/**
* Callback fired when the ended event fires when stop() is called on the
* stream.
*/
var endedCallback = () => {
this.mediaElement.removeEventListener('ended', endedCallback);
ok(true, "ended event successfully fired");
resolve();
};
this.mediaElement.addEventListener('ended', endedCallback);
this.mediaStream.stop();
// If ended doesn't fire in enough time, then we fail the test
setTimeout(() => {
reject(new Error("ended event never fired"));
}, ENDED_TIMEOUT_LENGTH);
});
}
}
});
// haxx to prevent SimpleTest from failing at window.onload
function addLoadEvent() {}

Просмотреть файл

@ -99,12 +99,6 @@ skip-if = android_version == '18' # android(Bug 1189784, timeouts on 4.3 emulato
[test_getUserMedia_scarySources.html]
skip-if = toolkit == 'android' # no screenshare or windowshare on android
[test_getUserMedia_spinEventLoop.html]
[test_getUserMedia_stopAudioStream.html]
[test_getUserMedia_stopAudioStreamWithFollowupAudio.html]
[test_getUserMedia_stopVideoAudioStream.html]
[test_getUserMedia_stopVideoAudioStreamWithFollowupVideoAudio.html]
[test_getUserMedia_stopVideoStream.html]
[test_getUserMedia_stopVideoStreamWithFollowupVideo.html]
[test_getUserMedia_trackCloneCleanup.html]
[test_getUserMedia_trackEnded.html]
[test_getUserMedia_peerIdentity.html]

Просмотреть файл

@ -27,7 +27,7 @@
checkMediaStreamContains(stream, [track, otherTrack], "Added video");
var testElem = createMediaElement('video', 'testAddTrackAudioVideo');
var playback = new LocalMediaStreamPlayback(testElem, stream);
var playback = new MediaStreamPlayback(testElem, stream);
return playback.playMedia(false);
}))
.then(() => getUserMedia({video: true})).then(stream =>
@ -43,7 +43,7 @@
checkMediaStreamContains(stream, [track, otherTrack], "Added video");
var test = createMediaElement('video', 'testAddTrackDoubleVideo');
var playback = new LocalMediaStreamPlayback(test, stream);
var playback = new MediaStreamPlayback(test, stream);
return playback.playMedia(false);
}))
.then(() => getUserMedia({video: true})).then(stream =>
@ -80,7 +80,7 @@
.then(() => {
stream.addTrack(track);
checkMediaStreamContains(stream, [track], "Re-added added-then-removed track");
var playback = new LocalMediaStreamPlayback(elem, stream);
var playback = new MediaStreamPlayback(elem, stream);
return playback.playMedia(false);
})
.then(() => otherTrack.stop());
@ -98,7 +98,7 @@
"2, Added external track");
var elem = createMediaElement('video', 'testAddRemoveOriginalTrackVideo');
var playback = new LocalMediaStreamPlayback(elem, audioStream);
var playback = new MediaStreamPlayback(elem, audioStream);
return playback.playMedia(false);
}))
.then(() => getUserMedia({ audio: true, video: true })).then(stream => {

Просмотреть файл

@ -134,7 +134,7 @@ runTest(async function() {
for (let testCase of testCases) {
let testAudio = createMediaElement("audio", `testAudio.${testCase.id}`);
let playback = new LocalMediaStreamPlayback(testAudio, testCase.gumStream);
let playback = new MediaStreamPlayback(testAudio, testCase.gumStream);
await playback.playMediaWithoutStoppingTracks(false);
}

Просмотреть файл

@ -107,7 +107,7 @@ runTest(async function() {
for (let testCase of testCases) {
let testAudio = createMediaElement("audio", `testAudio.${testCase.id}`);
let playback = new LocalMediaStreamPlayback(testAudio, testCase.gumStream);
let playback = new MediaStreamPlayback(testAudio, testCase.gumStream);
await playback.playMediaWithoutStoppingTracks(false);
}

Просмотреть файл

@ -9,14 +9,14 @@
createHTML({ title: "getUserMedia Basic Audio Test", bug: "781534" });
/**
* Run a test to verify that we can complete a start and stop media playback
* cycle for an audio LocalMediaStream on an audio HTMLMediaElement.
* cycle for an audio MediaStream on an audio HTMLMediaElement.
*/
runTest(function () {
var testAudio = createMediaElement('audio', 'testAudio');
var constraints = {audio: true};
return getUserMedia(constraints).then(stream => {
var playback = new LocalMediaStreamPlayback(testAudio, stream);
var playback = new MediaStreamPlayback(testAudio, stream);
return playback.playMedia(false);
});
});

Просмотреть файл

@ -106,7 +106,7 @@
`Height setting ${settings.height} should be set after gUM (or 0 per bug 1453247)`);
draw(helper.red, helper.blue,
helper.green, helper.grey);
let playback = new LocalMediaStreamPlayback(testVideo, stream);
let playback = new MediaStreamPlayback(testVideo, stream);
playback.startMedia();
await playback.verifyPlaying();
settings = stream.getTracks()[0].getSettings();
@ -149,7 +149,7 @@
`Height setting ${settings.height} should be correct after gUM (or 0 per bug 1453247)`);
draw(helper.green, helper.red,
helper.grey, helper.blue);
playback = new LocalMediaStreamPlayback(testVideo, stream);
playback = new MediaStreamPlayback(testVideo, stream);
playback.startMedia();
await playback.verifyPlaying();
settings = stream.getTracks()[0].getSettings();
@ -206,7 +206,7 @@
await verifyScreenshare(testVideo, helper,
helper.grey, helper.green,
helper.blue, helper.red);
await playback.deprecatedStopStreamInMediaPlayback();
await playback.stopTracksForStreamInMediaPlayback();
playback.detachFromMediaElement();
SpecialPowers.wrap(document).exitFullscreen();

Просмотреть файл

@ -12,7 +12,7 @@
});
/**
* Run a test to verify that we can complete a start and stop media playback
* cycle for a tabshare LocalMediaStream on a video HTMLMediaElement.
* cycle for a tabshare MediaStream on a video HTMLMediaElement.
*
* Additionally, exercise applyConstraints code for tabshare viewport offset.
*/
@ -27,8 +27,8 @@
fake: false
}))
.then(stream => {
var playback = new LocalMediaStreamPlayback(testVideo, stream);
return playback.playMediaWithDeprecatedStreamStop(false);
var playback = new MediaStreamPlayback(testVideo, stream);
return playback.playMedia(false);
})
.then(() => getUserMedia({
video: {
@ -41,7 +41,7 @@
fake: false
}))
.then(stream => {
var playback = new LocalMediaStreamPlayback(testVideo, stream);
var playback = new MediaStreamPlayback(testVideo, stream);
playback.startMedia(false);
return playback.verifyPlaying()
.then(() => Promise.all([
@ -55,7 +55,7 @@
() => listenUntil(testVideo, "resize", () => true)
]))
.then(() => playback.verifyPlaying()) // still playing
.then(() => playback.deprecatedStopStreamInMediaPlayback())
.then(() => playback.stopTracksForStreamInMediaPlayback())
.then(() => playback.detachFromMediaElement());
});
});

Просмотреть файл

@ -12,14 +12,14 @@
});
/**
* Run a test to verify that we can complete a start and stop media playback
* cycle for an video LocalMediaStream on a video HTMLMediaElement.
* cycle for an video MediaStream on a video HTMLMediaElement.
*/
runTest(function () {
var testVideo = createMediaElement('video', 'testVideo');
var constraints = {video: true};
return getUserMedia(constraints).then(stream => {
var playback = new LocalMediaStreamPlayback(testVideo, stream);
var playback = new MediaStreamPlayback(testVideo, stream);
return playback.playMedia(false);
});
});

Просмотреть файл

@ -12,14 +12,14 @@
});
/**
* Run a test to verify that we can complete a start and stop media playback
* cycle for a video and audio LocalMediaStream on a video HTMLMediaElement.
* cycle for a video and audio MediaStream on a video HTMLMediaElement.
*/
runTest(function () {
var testVideoAudio = createMediaElement('video', 'testVideoAudio');
var constraints = {video: true, audio: true};
return getUserMedia(constraints).then(stream => {
var playback = new LocalMediaStreamPlayback(testVideoAudio, stream);
var playback = new MediaStreamPlayback(testVideoAudio, stream);
return playback.playMedia(false);
});
});

Просмотреть файл

@ -19,7 +19,7 @@
var constraints = {video: true};
return getUserMedia(constraints).then(stream => {
var playback = new LocalMediaStreamPlayback(testVideo, stream);
var playback = new MediaStreamPlayback(testVideo, stream);
var video = playback.mediaElement;
video.srcObject = stream;

Просмотреть файл

@ -12,7 +12,7 @@
});
/**
* Run a test to verify that we can complete a start and stop media playback
* cycle for an screenshare LocalMediaStream on a video HTMLMediaElement.
* cycle for an screenshare MediaStream on a video HTMLMediaElement.
*/
runTest(function () {
var testVideo = createMediaElement('video', 'testVideo');
@ -25,8 +25,8 @@
};
return getUserMedia(constraints).then(stream => {
var playback = new LocalMediaStreamPlayback(testVideo, stream);
return playback.playMediaWithDeprecatedStreamStop(false);
var playback = new MediaStreamPlayback(testVideo, stream);
return playback.playMedia(false);
});
});

Просмотреть файл

@ -22,7 +22,7 @@
navigator.mozGetUserMedia(constraints, stream => {
checkMediaStreamTracks(constraints, stream);
var playback = new LocalMediaStreamPlayback(testAudio, stream);
var playback = new MediaStreamPlayback(testAudio, stream);
return playback.playMedia(false)
.then(() => resolve(), generateErrorCallback());
}, generateErrorCallback())

Просмотреть файл

@ -32,7 +32,7 @@
return;
}
ok(stream, "getUserMedia should get a stream!");
let playback = new LocalMediaStreamPlayback(testAudio, stream);
let playback = new MediaStreamPlayback(testAudio, stream);
return playback.playMedia(false);
});

Просмотреть файл

@ -16,20 +16,19 @@
return getUserMedia({video: true})
.then(videoStream => {
var testVideo = createMediaElement('video', 'testVideo');
var videoPlayback = new LocalMediaStreamPlayback(testVideo,
videoStream);
var videoPlayback = new MediaStreamPlayback(testVideo,
videoStream);
return videoPlayback.playMedia(false)
return videoPlayback.playMediaWithoutStoppingTracks(false)
.then(() => getUserMedia({audio: true}))
.then(audioStream => {
var testAudio = createMediaElement('audio', 'testAudio');
var audioPlayback = new LocalMediaStreamPlayback(testAudio,
audioStream);
var audioPlayback = new MediaStreamPlayback(testAudio,
audioStream);
return audioPlayback.playMedia(false)
.then(() => audioStream.stop());
return audioPlayback.playMedia(false);
})
.then(() => videoStream.stop());
.then(() => videoStream.getTracks().forEach(t => t.stop()));
});
});

Просмотреть файл

@ -157,8 +157,6 @@ runTest(() => getUserMedia({audio: true, video: true})
"video element should capture only 1 video track until ended");
untilEndedElement.srcObject.getTracks().forEach(t => t.stop());
// TODO(1208316) We stop the stream to make the media element end.
untilEndedElement.srcObject.stop();
return Promise.all([
haveEvent(untilEndedElement, "ended", wait(50000, new Error("Timeout"))),

Просмотреть файл

@ -69,7 +69,6 @@ runTest(async () => {
// Not part of streamClone. Does not get stopped by the playback test.
otherTrack.stop();
otherStream.stop();
let test = createMediaElement('video', 'testClonePlayback');
let playback = new MediaStreamPlayback(test, streamClone);

Просмотреть файл

@ -13,7 +13,7 @@
runTest(function () {
return getUserMedia({audio: true}).then(audioStream => {
var testAudio = createMediaElement('audio', 'testAudio');
var playback = new LocalMediaStreamPlayback(testAudio, audioStream);
var playback = new MediaStreamPlayback(testAudio, audioStream);
return playback.playMediaWithoutStoppingTracks(false)
.then(() => playback.playMedia(true));

Просмотреть файл

@ -13,7 +13,7 @@
runTest(function () {
return getUserMedia({video: true, audio: true}).then(stream => {
var testVideo = createMediaElement('video', 'testVideo');
var playback = new LocalMediaStreamPlayback(testVideo, stream);
var playback = new MediaStreamPlayback(testVideo, stream);
return playback.playMediaWithoutStoppingTracks(false)
.then(() => playback.playMedia(true));

Просмотреть файл

@ -13,7 +13,7 @@
runTest(function () {
return getUserMedia({video: true}).then(stream => {
var testVideo = createMediaElement('video', 'testVideo');
var streamPlayback = new LocalMediaStreamPlayback(testVideo, stream);
var streamPlayback = new MediaStreamPlayback(testVideo, stream);
return streamPlayback.playMediaWithoutStoppingTracks(false)
.then(() => streamPlayback.playMedia(true));

Просмотреть файл

@ -1,27 +0,0 @@
<!DOCTYPE HTML>
<html>
<head>
<script type="application/javascript" src="mediaStreamPlayback.js"></script>
</head>
<body>
<pre id="test">
<script type="application/javascript">
createHTML({ title: "getUserMedia Stop Audio Stream", bug: "822109" });
/**
* Run a test to verify that we can start an audio stream in a media element,
* call stop() on the stream, and successfully get an ended event fired.
*/
runTest(function () {
return getUserMedia({audio: true})
.then(stream => {
var testAudio = createMediaElement('audio', 'testAudio');
var streamPlayback = new LocalMediaStreamPlayback(testAudio, stream);
return streamPlayback.playMediaWithDeprecatedStreamStop(false);
});
});
</script>
</pre>
</body>
</html>

Просмотреть файл

@ -1,35 +0,0 @@
<!DOCTYPE HTML>
<html>
<head>
<script type="application/javascript" src="mediaStreamPlayback.js"></script>
</head>
<body>
<pre id="test">
<script type="application/javascript">
createHTML({ title: "getUserMedia Stop Audio Stream With Followup Audio", bug: "822109" });
/**
* Run a test to verify that I can complete an audio gum playback in a media
* element, stop the stream, and then complete another audio gum playback
* in a media element.
*/
runTest(function () {
return getUserMedia({audio: true})
.then(firstStream => {
var testAudio = createMediaElement('audio', 'testAudio');
var streamPlayback = new LocalMediaStreamPlayback(testAudio, firstStream);
return streamPlayback.playMediaWithDeprecatedStreamStop(false)
.then(() => getUserMedia({audio: true}))
.then(secondStream => {
streamPlayback.mediaStream = secondStream;
return streamPlayback.playMedia(false)
.then(() => secondStream.stop());
});
});
});
</script>
</pre>
</body>
</html>

Просмотреть файл

@ -1,28 +0,0 @@
<!DOCTYPE HTML>
<html>
<head>
<script type="application/javascript" src="mediaStreamPlayback.js"></script>
</head>
<body>
<pre id="test">
<script type="application/javascript">
createHTML({ title: "getUserMedia Stop Video Audio Stream", bug: "822109" });
/**
* Run a test to verify that we can start a video+audio stream in a
* media element, call stop() on the stream, and successfully get an
* ended event fired.
*/
runTest(function () {
return getUserMedia({video: true, audio: true})
.then(stream => {
var testVideo = createMediaElement('video', 'testVideo');
var playback = new LocalMediaStreamPlayback(testVideo, stream);
return playback.playMediaWithDeprecatedStreamStop(false);
});
});
</script>
</pre>
</body>
</html>

Просмотреть файл

@ -1,38 +0,0 @@
<!DOCTYPE HTML>
<html>
<head>
<script type="application/javascript" src="mediaStreamPlayback.js"></script>
</head>
<body>
<pre id="test">
<script type="application/javascript">
createHTML({
title: "getUserMedia Stop Video+Audio Stream With Followup Video+Audio",
bug: "822109"
});
/**
* Run a test to verify that I can complete an video+audio gum playback in a
* media element, stop the stream, and then complete another video+audio gum
* playback in a media element.
*/
runTest(function () {
return getUserMedia({video: true, audio: true})
.then(stream => {
var testVideo = createMediaElement('video', 'testVideo');
var streamPlayback = new LocalMediaStreamPlayback(testVideo, stream);
return streamPlayback.playMediaWithDeprecatedStreamStop(false)
.then(() => getUserMedia({video: true, audio: true}))
.then(secondStream => {
streamPlayback.mediaStream = secondStream;
return streamPlayback.playMedia(false)
.then(() => secondStream.stop());
});
});
});
</script>
</pre>
</body>
</html>

Просмотреть файл

@ -1,28 +0,0 @@
<!DOCTYPE HTML>
<html>
<head>
<script type="application/javascript" src="mediaStreamPlayback.js"></script>
</head>
<body>
<pre id="test">
<script type="application/javascript">
createHTML({ title: "getUserMedia Stop Video Stream", bug: "822109" });
/**
* Run a test to verify that we can start a video stream in a
* media element, call stop() on the stream, and successfully get an
* ended event fired.
*/
runTest(function () {
return getUserMedia({video: true})
.then(stream => {
var testVideo = createMediaElement('video', 'testVideo');
var streamPlayback = new LocalMediaStreamPlayback(testVideo, stream);
return streamPlayback.playMediaWithDeprecatedStreamStop(false);
});
});
</script>
</pre>
</body>
</html>

Просмотреть файл

@ -1,35 +0,0 @@
<!DOCTYPE HTML>
<html>
<head>
<script src="mediaStreamPlayback.js"></script>
</head>
<body>
<pre id="test">
<script type="application/javascript">
createHTML({ title: "getUserMedia Stop Video Stream With Followup Video", bug: "822109" });
/**
* Run a test to verify that I can complete an video gum playback in a
* media element, stop the stream, and then complete another video gum
* playback in a media element.
*/
runTest(function () {
return getUserMedia({video: true})
.then(stream => {
var testVideo = createMediaElement('video', 'testVideo');
var streamPlayback = new LocalMediaStreamPlayback(testVideo, stream);
return streamPlayback.playMediaWithDeprecatedStreamStop(false)
.then(() => getUserMedia({video: true}))
.then(secondStream => {
streamPlayback.mediaStream = secondStream;
return streamPlayback.playMedia(false)
.then(() => secondStream.stop());
});
});
});
</script>
</pre>
</body>
</html>

Просмотреть файл

@ -606,8 +606,6 @@ var interfaceNamesInGlobalScope =
{name: "KeyboardEvent", insecureContext: true},
// IMPORTANT: Do not change this list without review from a DOM peer!
{name: "KeyframeEffect", insecureContext: true},
// IMPORTANT: Do not change this list without review from a DOM peer!
{name: "LocalMediaStream", insecureContext: true},
// IMPORTANT: Do not change this list without review from a DOM peer!
{name: "Location", insecureContext: true},
// IMPORTANT: Do not change this list without review from a DOM peer!

Просмотреть файл

@ -1,15 +0,0 @@
/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
* You can obtain one at http://mozilla.org/MPL/2.0/.
*
* The origins of this IDL file are
* http://dev.w3.org/2011/webrtc/editor/getusermedia.html
*
* Copyright © 2012 W3C® (MIT, ERCIM, Keio), All Rights Reserved. W3C
* liability, trademark and document use rules apply.
*/
interface LocalMediaStream : MediaStream {
void stop();
};

Просмотреть файл

@ -172,9 +172,6 @@ with Files("KeyIdsInitData.webidl"):
with Files("Keyframe*"):
BUG_COMPONENT = ("Core", "DOM: Animation")
with Files("LocalMediaStream.webidl"):
BUG_COMPONENT = ("Core", "Audio/Video")
with Files("MediaDevice*"):
BUG_COMPONENT = ("Core", "WebRTC")
@ -638,7 +635,6 @@ WEBIDL_FILES = [
'L10nUtils.webidl',
'LegacyQueryInterface.webidl',
'LinkStyle.webidl',
'LocalMediaStream.webidl',
'Location.webidl',
'MediaCapabilities.webidl',
'MediaDeviceInfo.webidl',

Просмотреть файл

@ -492,8 +492,6 @@ public:
return ds.forget();
}
virtual void Stop() {} // Really DOMLocalMediaStream
virtual bool AddDirectListener(Fake_MediaStreamListener *aListener) { return false; }
virtual void RemoveDirectListener(Fake_MediaStreamListener *aListener) {}
@ -645,7 +643,6 @@ typedef Fake_MediaStreamListener MediaStreamListener;
typedef Fake_MediaStreamTrackListener MediaStreamTrackListener;
typedef Fake_DirectMediaStreamTrackListener DirectMediaStreamTrackListener;
typedef Fake_DOMMediaStream DOMMediaStream;
typedef Fake_DOMMediaStream DOMLocalMediaStream;
typedef Fake_MediaStreamVideoSink MediaStreamVideoSink;
namespace dom {

Просмотреть файл

@ -35,14 +35,14 @@
function stopMedia() {
if (video_status) {
video.srcObject.stop();
video.srcObject.getTracks().forEach(t => t.stop());
video.srcObject = null;
content.removeChild(video);
capturing = false;
video_status = false;
}
if (audio_status) {
audio.srcObject.stop();
audio.srcObject.getTracks().forEach(t => t.stop());
audio.srcObject = null;
content.removeChild(audio);
audio_status = false;
@ -72,8 +72,8 @@
document.title += "video";
}
document.title += " gumtest";
audio.srcObject.stop();
video.srcObject.stop();
audio.srcObject.getTracks().forEach(t => t.stop());
video.srcObject.getTracks().forEach(t => t.stop());
}, function(err) {
document.title = "failed gumtest";
stopMedia();

Просмотреть файл

@ -32,14 +32,14 @@
function stopMedia() {
if (video_status) {
video.srcObject.stop();
video.srcObject.getTracks().forEach(t => t.stop());
video.srcObject = null;
content.removeChild(video);
capturing = false;
video_status = false;
}
if (audio_status) {
audio.srcObject.stop();
audio.srcObject.getTracks().forEach(t => t.stop());
audio.srcObject = null;
content.removeChild(audio);
audio_status = false;
@ -69,8 +69,8 @@
document.title += "video";
}
document.title += " gumtest";
audio.srcObject.stop();
video.srcObject.stop();
audio.srcObject.getTracks().forEach(t => t.stop());
video.srcObject.getTracks().forEach(t => t.stop());
}, function(err) {
document.title = "failed gumtest";
stopMedia();

Просмотреть файл

@ -194,7 +194,6 @@ idl_test(
DragEvent: [],
NavigatorUserMediaError: [],
MediaStream: [],
LocalMediaStream: [],
MediaStreamTrack: [],
MediaStreamRecorder: [],
PeerConnection: [],