add auto pip mode

This commit is contained in:
zhw2590582 committed 2019-09-08 12:41:27 +08:00
1 parent 8dc8dc3a3e
commit 6c0a198f02
9 files changed
+83 -31

No files matched your search

-3
View File
@@ -2,7 +2,6 @@ import { append, setStyle } from '../utils';
function nativePip(art, player) {
const {
notice,
template: { $video },
events: { proxy },
} = art;
@@ -16,12 +15,10 @@ function nativePip(art, player) {
set(value) {
if (value) {
$video.requestPictureInPicture().catch(error => {
notice.show(error, true, 3000);
throw error;
});
} else {
document.exitPictureInPicture().catch(error => {
notice.show(error, true, 3000);
throw error;
});
}