mirror of
https://github.com/zhw2590582/ArtPlayer.git
synced 2026-10-23 13:51:20 -08:00
Revert "refactor: Update video element resizing logic in Artplayer and artplayer-proxy-webav"
This reverts commit 77a3438e2d.
This commit is contained in:
1 parent
77a3438e2d
commit
71a1126aae
3 files changed
+5
-15
No files matched your search
@@ -278,7 +278,7 @@ function artplayerProxyWebAV() {
|
||||
}
|
||||
function resize() {
|
||||
const player = art.template?.$player;
|
||||
if (!player || state.autoSize) return;
|
||||
if (!player || option.autoSize) return;
|
||||
const aspectRatio = canvas.videoWidth / canvas.videoHeight;
|
||||
const containerWidth = player.clientWidth;
|
||||
const containerHeight = player.clientHeight;
|
||||
@@ -377,7 +377,6 @@ function artplayerProxyWebAV() {
|
||||
def(canvas, "currentTime", {
|
||||
get: ()=>state.currentTime,
|
||||
set: (val)=>{
|
||||
if (state.readyState < 4) return;
|
||||
const newTime = Math.max(0, Math.min(val, state.duration));
|
||||
const now = performance.now();
|
||||
if (now - lastSeekTime > 16) {
|
||||
@@ -403,7 +402,7 @@ function artplayerProxyWebAV() {
|
||||
set: (val)=>{
|
||||
option.url = val;
|
||||
init().then(()=>{
|
||||
if (state.autoplay) canvas.play();
|
||||
if (option.autoplay) canvas.play();
|
||||
});
|
||||
}
|
||||
});
|
||||
@@ -448,8 +447,6 @@ function artplayerProxyWebAV() {
|
||||
});
|
||||
def(canvas, "play", {
|
||||
value: async ()=>{
|
||||
if (state.readyState < 4) return false;
|
||||
await init();
|
||||
await play();
|
||||
art.emit("video:play", {
|
||||
type: "play"
|
||||
@@ -457,12 +454,10 @@ function artplayerProxyWebAV() {
|
||||
art.emit("video:playing", {
|
||||
type: "playing"
|
||||
});
|
||||
return true;
|
||||
}
|
||||
});
|
||||
def(canvas, "pause", {
|
||||
value: ()=>{
|
||||
if (state.readyState < 4) return;
|
||||
stop();
|
||||
state.playing = false;
|
||||
state.paused = true;
|
||||
|
||||
Reference in new issue
Block a user