我正在使用OpenTok,我正试图开启/关闭视频显示。 所以我使用以下pubOptions
<?php
//checks if username inserted is already in use
function check_username($username_pretended) {
global $conn;
$stmt = $conn->prepare('SELECT * FROM CommonUsers WHERE username=?');
$stmt->execute(array($username_pretended));
$res = $stmt->fetch();
if($res['username'] == "") {
return false;
}
else return true;
}
//inserts an user in the database
function insertUser($name, $username, $email, $password) {
global $conn;
$stmt = $conn->prepare('INSERT INTO CommonUsers(name, username, email, password) VALUES (?, ?, ?, ?)');
$stmt->execute(array($name, $username, $email, $password));
}
?>
但两种情况下都会显示视频窗口。
答案 0 :(得分:0)
https://tokbox.com/opentok/libraries/client/js/reference/OT.html#initPublisher
我相信你想要pubOptions = {publishVideo: false, style:{buttonDisplayMode: 'off'}};
答案 1 :(得分:0)
请查看以下文档:https://tokbox.com/opentok/tutorials/audio-video/js/#publish_audio_video_only
如果您想在发布后停用视频,则需要:
publisher.publishVideo(false);
答案 2 :(得分:0)
我不确定你要找的是什么,但你可以尝试一下......
session.unpublish(); //取消发布您的流/视频
session.forceUnpublish(); //未发布您的strea / video并强制其他流也未发布