1

我使用下面提到的代码在“index.js”中添加了本地视频:

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;
};

'index.html' 中的 html 代码是这样的:

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

并尝试在单击按钮时切换或隐藏此“localVideo”或“localVideoDiv”,但不能。

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

请提出一些解决方案。提前致谢。注意:无法调整上面的 html 代码。视频标签正在格式化中发布

4

0 回答 0