mirror of
https://github.com/zhw2590582/ArtPlayer.git
synced 2026-10-17 01:56:16 -08:00
refactor: Update video element in Artplayer to support custom canvas or video
This commit is contained in:
1 parent
984755b442
commit
ced8fb4fb1
4 files changed
+18
-15
No files matched your search
@@ -166,14 +166,14 @@ function artplayerProxyWebAV() {
|
||||
videoWidth: 0,
|
||||
videoHeight: 0,
|
||||
currentTime: 0,
|
||||
volume: 1,
|
||||
autoplay: false,
|
||||
playbackRate: 1,
|
||||
paused: true,
|
||||
ended: false,
|
||||
readyState: 0,
|
||||
muted: false,
|
||||
buffered: 0
|
||||
buffered: 0,
|
||||
muted: option.muted,
|
||||
volume: option.volume,
|
||||
autoplay: option.autoplay
|
||||
};
|
||||
function reset() {
|
||||
Object.assign(state, {
|
||||
@@ -182,14 +182,14 @@ function artplayerProxyWebAV() {
|
||||
videoWidth: 0,
|
||||
videoHeight: 0,
|
||||
currentTime: 0,
|
||||
volume: 1,
|
||||
autoplay: false,
|
||||
playbackRate: 1,
|
||||
paused: true,
|
||||
ended: false,
|
||||
readyState: 0,
|
||||
muted: false,
|
||||
buffered: 0
|
||||
buffered: 0,
|
||||
muted: option.muted,
|
||||
volume: option.volume,
|
||||
autoplay: option.autoplay
|
||||
});
|
||||
}
|
||||
function stop() {
|
||||
@@ -204,6 +204,7 @@ function artplayerProxyWebAV() {
|
||||
}
|
||||
function updateVolume() {
|
||||
if (gainNode) {
|
||||
console.log("updateVolume", state.volume);
|
||||
const effectiveVolume = state.muted ? 0 : state.volume;
|
||||
gainNode.gain.setValueAtTime(effectiveVolume, audioCtx.currentTime);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user