Hello I've built a code for camera access in javascript and codeigniter. In client Side i've this:
Code:
#index.php;
<div class="container">
<div class="row">
<video autoplay="true" id="videoElement0" class="col-md-3" >
</video>
<video autoplay="true" id="videoElement2" class="col-md-3" >
</video>
</div>
</div>
<script>
var video= document.querySelector("#videoElement0");
navigator.getUserMedia = navigator.getUserMedia || navigator.webkitGetUserMedia || navigator.mozGetUserMedia || navigator.msGetUserMedia || navigator.oGetUserMedia;
if (navigator.getUserMedia) {
navigator.getUserMedia({video: true,audio: true}, handleVideo, videoError);
}
function handleVideo(stream) {
video.src =window.URL.createObjectURL(stream);
var a = document.getElementById("videosrc");
a.value = video.src;
var videosrc=$("#videosrc").serialize();
$.ajax({type:"POST",url:"' . base_url() . 'index.php/' . '",
data: videosrc,
success:function(response){
;
}
});
}
</script>
and the video shows.
What i want is a connections between two users in mobile, since one user image is made.
The issue is that in mobile image i've blob (blob:7B72C5FD-E740-4C24-B2BC-53ABA6C70B70)
Why i can play blob whith this code.
$("#videoElement2").html('<source src="blob:7B72C5FD-E740-4C24-B2BC-53ABA6C70B70"></source>');
var $video = $('#videoElement2');
$video[0].load();
$video[0].play();
Thanks