6

video画中画(小窗口)

 2 years ago
source link: https://blog.p2hp.com/archives/9088
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

video画中画(小窗口)

<video
   id="video_paly"
   controls
   src="https://v-cdn.zjol.com.cn/280443.mp4"
   poster="https://ossweb-img.qq.com/images/lol/web201310/skin/big91012.jpg">
   您的浏览器不支持 video 标签。
 </video>
 <button 
 	onClick={() => {
	    var video: any = document.getElementById("video_paly");
	    video.requestPictureInPicture();
 	}}
 >开启画中画</button>
 <button 
 	onClick={() => {
    	document.exitPictureInPicture();
 	}}
 >关闭画中画</button>

那么浏览器但凡有video标签,就可以用此脚本快速打开小窗

 document.getElementsByTagName('video')[0].requestPictureInPicture();

转发请注明出处:https://blog.csdn.net/weixin_43356511/article/details/120860260


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK