mirror of
https://github.com/zhw2590582/ArtPlayer.git
synced 2026-10-25 08:01:20 -08:00
remove player object
This commit is contained in:
1 parent
59a8ccce81
commit
59400eb3bf
58 files changed
+295
-313
No files matched your search
@@ -1,6 +1,6 @@
|
||||
import { def } from '../utils';
|
||||
|
||||
function nativePip(art, player) {
|
||||
function nativePip(art) {
|
||||
const {
|
||||
template: { $video },
|
||||
events: { proxy },
|
||||
@@ -9,7 +9,7 @@ function nativePip(art, player) {
|
||||
|
||||
$video.disablePictureInPicture = false;
|
||||
|
||||
def(player, 'pip', {
|
||||
def(art, 'pip', {
|
||||
get() {
|
||||
return document.pictureInPictureElement;
|
||||
},
|
||||
@@ -37,12 +37,12 @@ function nativePip(art, player) {
|
||||
});
|
||||
}
|
||||
|
||||
function webkitPip(art, player) {
|
||||
function webkitPip(art) {
|
||||
const { $video } = art.template;
|
||||
|
||||
$video.webkitSetPresentationMode('inline');
|
||||
|
||||
def(player, 'pip', {
|
||||
def(art, 'pip', {
|
||||
get() {
|
||||
return $video.webkitPresentationMode === 'picture-in-picture';
|
||||
},
|
||||
@@ -58,18 +58,18 @@ function webkitPip(art, player) {
|
||||
});
|
||||
}
|
||||
|
||||
export default function pipMix(art, player) {
|
||||
export default function pipMix(art) {
|
||||
const {
|
||||
i18n,
|
||||
notice,
|
||||
template: { $video },
|
||||
} = art;
|
||||
if (document.pictureInPictureEnabled) {
|
||||
nativePip(art, player);
|
||||
nativePip(art);
|
||||
} else if ($video.webkitSupportsPresentationMode) {
|
||||
webkitPip(art, player);
|
||||
webkitPip(art);
|
||||
} else {
|
||||
def(player, 'pip', {
|
||||
def(art, 'pip', {
|
||||
get() {
|
||||
return false;
|
||||
},
|
||||
|
||||
Reference in new issue
Block a user