mirror of
https://github.com/zhw2590582/ArtPlayer.git
synced 2026-10-24 23:51:20 -08:00
refactor: Improve video element resizing logic in Artplayer and artplayer-proxy-webav
This commit is contained in:
1 parent
71a1126aae
commit
1d0139ee35
3 files changed
+7
-1
No files matched your search
@@ -377,6 +377,7 @@ 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) {
|
||||
@@ -447,6 +448,7 @@ function artplayerProxyWebAV() {
|
||||
});
|
||||
def(canvas, "play", {
|
||||
value: async ()=>{
|
||||
if (state.readyState < 4) return false;
|
||||
await play();
|
||||
art.emit("video:play", {
|
||||
type: "play"
|
||||
@@ -454,6 +456,7 @@ function artplayerProxyWebAV() {
|
||||
art.emit("video:playing", {
|
||||
type: "playing"
|
||||
});
|
||||
return true;
|
||||
}
|
||||
});
|
||||
def(canvas, "pause", {
|
||||
|
||||
Reference in new issue
Block a user