During HTML5 implementation regarding media capabilities by referring to https://davidwalsh.name/demo/camera.php, it points to
var video = document.getElementById('video');
if(navigator.mediaDevices && navigator.mediaDevices.getUserMedia) {
// Not adding `{ audio: true }` since we only want video now
navigator.mediaDevices.getUserMedia({ video: true }).then(function(stream) {
video.src = window.URL.createObjectURL(stream);
video.play();
});
}
for video streaming the object.
Instead of that i want to use angular way to achieve this, so i applied these changes :
var video = angular.element($("video"));
if(navigator.mediaDevices && navigator.mediaDevices.getUserMedia) {
// Not adding `{ audio: true }` since we only want video now
navigator.mediaDevices.getUserMedia({ video: true }).then(function(stream) {
video.src = window.URL.createObjectURL(stream);
video.play();
});
}
But from angularjs approach, I am unable to stream the video object, any suggestions on this or any alternative approach?