Bug 1183495 - part3: Remove mozSrcObject usage. r=jwwang

MozReview-Commit-ID: Gtpne3O0pBQ

--HG--
extra : rebase_source : 87544aa023e5ac079a8ae02de77e2aeab91e97cf
This commit is contained in:
bechen@mozilla.com 2017-10-20 11:23:41 +08:00
Родитель 35226e578f
Коммит c09e4a8ee9
7 изменённых файлов: 17 добавлений и 21 удалений

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

@ -11,7 +11,7 @@ navigator.mozGetUserMedia({audio: true, fake: true}, function(stream) {
document.querySelector("html").className = "";
}
})
testAudio.mozSrcObject = stream;
testAudio.srcObject = stream;
testAudio.play();
}, function(err) {
// Don't go orange if we can't get an audio input stream,

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

@ -106,7 +106,7 @@ function startTest() {
}
var steps = 0;
element.mozSrcObject = stream;
element.srcObject = stream;
element.onplaying = onplaying;
element.onended = onended;
element.play();

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

@ -49,9 +49,7 @@ var doTest = srcObject => new Promise(resolve => {
b.play();
});
// TODO: remove prefixed version soon (1183495).
var doTests = () => doTest("srcObject").then(() => doTest("mozSrcObject"))
var doTests = () => doTest("srcObject")
.catch(e => ok(false, "Unexpected error: " + e))
.then(() => SimpleTest.finish())
.catch(e => ok(false, "Coding error: " + e));

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

@ -69,7 +69,7 @@ scriptsReady
oscThroughMediaElement.connect(msDest);
oscThroughAudioDestinationNode.connect(ac.destination);
acTone.mozSrcObject = msDest.stream;
acTone.srcObject = msDest.stream;
getSineWaveFile(10000, 10, function(blob) {
wavtone.src = URL.createObjectURL(blob);

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

@ -53,7 +53,7 @@ pc2.onicecandidate = e => {
var v1, v2;
var delivered = new Promise(resolve => {
pc2.onaddstream = e => {
v2.mozSrcObject = e.stream;
v2.srcObject = e.stream;
resolve(e.stream);
};
});
@ -66,7 +66,7 @@ runNetworkTest(function() {
// not testing legacy gUM here
navigator.mediaDevices.getUserMedia({ video: true, audio: true })
.then(stream => pc1.addStream(v1.mozSrcObject = stream))
.then(stream => pc1.addStream(v1.srcObject = stream))
.then(() => pcall(pc1, pc1.createOffer))
.then(offer => pcall(pc1, pc1.setLocalDescription, offer))
.then(() => pcall(pc2, pc2.setRemoteDescription, pc1.localDescription))
@ -75,7 +75,7 @@ runNetworkTest(function() {
.then(() => pcall(pc1, pc1.setRemoteDescription, pc2.localDescription))
.then(() => delivered)
// .then(() => canPlayThrough) // why doesn't this fire?
.then(() => waitUntil(() => v2.currentTime > 0 && v2.mozSrcObject.currentTime > 0))
.then(() => waitUntil(() => v2.currentTime > 0 && v2.srcObject.currentTime > 0))
.then(() => ok(v2.currentTime > 0, "v2.currentTime is moving (" + v2.currentTime + ")"))
.then(() => ok(true, "Connected."))
.then(() => pcall(pc1, pc1.getStats, null))

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

@ -110,13 +110,13 @@ if (navigator.mozGetUserMedia) {
// Attach a media stream to an element.
attachMediaStream = function(element, stream) {
console.log("Attaching media stream");
element.mozSrcObject = stream;
element.srcObject = stream;
element.play();
};
reattachMediaStream = function(to, from) {
console.log("Reattaching media stream");
to.mozSrcObject = from.mozSrcObject;
to.srcObject = from.srcObject;
to.play();
};
@ -194,8 +194,6 @@ if (navigator.mozGetUserMedia) {
attachMediaStream = function(element, stream) {
if (typeof element.srcObject !== 'undefined') {
element.srcObject = stream;
} else if (typeof element.mozSrcObject !== 'undefined') {
element.mozSrcObject = stream;
} else if (typeof element.src !== 'undefined') {
element.src = URL.createObjectURL(stream);
} else {

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

@ -32,15 +32,15 @@
function stopMedia() {
if (video_status) {
video.mozSrcObject.stop();
video.mozSrcObject = null;
video.srcObject.stop();
video.srcObject = null;
content.removeChild(video);
capturing = false;
video_status = false;
}
if (audio_status) {
audio.mozSrcObject.stop();
audio.mozSrcObject = null;
audio.srcObject.stop();
audio.srcObject = null;
content.removeChild(audio);
audio_status = false;
}
@ -51,12 +51,12 @@
window.navigator.mozGetUserMedia(param, function(stream) {
if (video_status) {
content.appendChild(video);
video.mozSrcObject = stream;
video.srcObject = stream;
video.play();
}
if (audio_status) {
content.appendChild(audio);
audio.mozSrcObject = stream;
audio.srcObject = stream;
audio.play();
}
var audioTracks = stream.getAudioTracks();
@ -69,8 +69,8 @@
document.title += "video";
}
document.title += " gumtest";
audio.mozSrcObject.stop();
video.mozSrcObject.stop();
audio.srcObject.stop();
video.srcObject.stop();
}, function(err) {
document.title = "failed gumtest";
stopMedia();