1

I've added local video in 'index.js' using below mentioned code:

connection.onstreamL = function(event) {
    connection.videosContainer = document.getElementById('localVideoDiv');
    var video = document.getElementById('localVideo');

    video.srcObject = event.stream;
    var width = parseInt(connection.videosContainer.clientWidth);
    var mediaElement = getHTMLMediaElement(video, {
                                           /*  title: event.userid,*/
                                           buttons: ['full-screen'],
                                           width:width
                                           });

    connection.videosContainer.appendChild(mediaElement);

    mediaElement.id = event.streamid;
};

and html code in 'index.html' is like this:

<div class="patient-video" id="localVideoDiv"> 
<video loop muted autoplay poster="img/videoframe.jpg" class="" id="localVideo">
</video>
</div>

and try to toggle or hide this 'localVideo' or 'localVideoDiv' on click of button, but can't.

$(".preview").click(function(e) { $("#localVideo").slideToggle(); });

Kindly suggest some solution. Thanks in advance. Note: unable to adjust html code above. video tag is issuing in formating

Hassy
  • 5,068
  • 5
  • 38
  • 63
s.zainulabideen
  • 2,047
  • 1
  • 13
  • 13
  • Have you tried to hide video using "$('#localVideo').hide()" from console, just to ensure if it works. – Mhadonis Dec 11 '17 at 05:36
  • Yeah, I had tried almost everything like this. But Actual problem as I can understand is that video stream/source is not really in html page. I mean, if I select html DOM or body, video is still show outside the selection. please see image in below link. https://groups.google.com/forum/#!topic/cordova-plugin-iosrtc/en0ilfgb5YE – s.zainulabideen Dec 11 '17 at 06:19
  • Remove the video tag from "localVideoDiv" and just append the incoming stream "mediaElement". – Mhadonis Dec 11 '17 at 08:42
  • Did exactly that.. but no success.. – s.zainulabideen Dec 11 '17 at 11:40

0 Answers0