[Webkit-unassigned] [Bug 181053] Safari on iOS 11.2.5 - .srcObject does not work
bugzilla-daemon at webkit.org
bugzilla-daemon at webkit.org
Wed Dec 20 15:00:51 PST 2017
https://bugs.webkit.org/show_bug.cgi?id=181053
--- Comment #3 from iamtesting <shamun at companysocia.com> ---
FYI - Tested code:
==
<!DOCTYPE html>
<html>
<head>
<title>getUserMedia</title>
</head>
<body>
<div id="container">
<video id="localVideo" autoplay playsinline></video>
<video id="miniVideo" autoplay playsinline style="position: fixed;bottom:0px;right:10px;width: 150px;height:150px;border:solid 5px red;"></video>
</div>
<script src="https://webrtc.github.io/adapter/adapter-latest.js"></script>
<script src="https://webrtc.github.io/samples/src/js/common.js"></script>
<script>
'use strict';
var mainVideoSeflView = document.getElementById('localVideo');
var pictureInPicture = document.getElementById('miniVideo');
// Put variables in global scope to make them available to the browser console.
var constraints = window.constraints = {
audio: false,
video: true
};
function handleSuccess(stream) {
var videoTracks = stream.getVideoTracks();
console.log('Got stream with constraints:', constraints);
console.log('Using video device: ' + videoTracks[0].label);
stream.oninactive = function() {
console.log('Stream inactive');
};
window.stream = stream; // make variable available to browser console
mainVideoSeflView.srcObject = stream;
pictureInPicture.srcObject = mainVideoSeflView.srcObject;
}
function handleError(error) {
if (error.name === 'ConstraintNotSatisfiedError') {
errorMsg('The resolution ' + constraints.video.width.exact + 'x' +
constraints.video.width.exact + ' px is not supported by your device.');
} else if (error.name === 'PermissionDeniedError') {
errorMsg('Permissions have not been granted to use your camera and ' +
'microphone, you need to allow the page access to your devices in ' +
'order for the demo to work.');
}
errorMsg('getUserMedia error: ' + error.name, error);
}
function errorMsg(msg, error) {
if (typeof error !== 'undefined') {
console.error(error);
}
}
navigator.mediaDevices.getUserMedia(constraints).
then(handleSuccess).catch(handleError);
</script>
</body>
</html>
--
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-unassigned/attachments/20171220/f55edc48/attachment.html>
More information about the webkit-unassigned
mailing list