我使用webrtc创建了视频调用应用程序,并在安卓和iOS上成功地使用Cordova创建了视频调用应用程序。
接下来,我开始在我的web应用程序中使用JavaScript创建图片模式,这也很好,但我的移动应用程序不支持请求图片模式。
如何启用和控制JavaScript图像模式、android和iOS设备?
async function videoShrink(video){
var video = document.getElementsByTagName("video")[0];
try {
// If there is no element in Picture-in-Picture yet, request for it
if (video !== document.pictureInPictureElement) {
await video.requestPictureInPicture();
}
// If Picture-in-Picture already exists, exit the mode
else {
await document.exitPictureInPicture();
}
} catch (error) {
// console.log(`Oh Horror! ${error}`);
console.log(error);
}
}发布于 2022-10-01 05:07:39
video.requestPictureInPicture();
不用于CSS Cordova平台,因此只能使用CSS动画自定义布局。
发布于 2022-06-25 12:41:56
https://stackoverflow.com/questions/72752385
复制相似问题