mirror of
https://github.com/zhw2590582/ArtPlayer.git
synced 2026-10-18 10:41:20 -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
@@ -22,14 +22,14 @@ export default function artplayerProxyWebAV() {
|
||||
videoWidth: 0,
|
||||
videoHeight: 0,
|
||||
currentTime: 0,
|
||||
volume: 1,
|
||||
autoplay: false,
|
||||
playbackRate: 1,
|
||||
paused: true,
|
||||
ended: false,
|
||||
readyState: 0,
|
||||
muted: false,
|
||||
buffered: 0,
|
||||
muted: option.muted,
|
||||
volume: option.volume,
|
||||
autoplay: option.autoplay,
|
||||
};
|
||||
|
||||
function reset() {
|
||||
@@ -39,14 +39,14 @@ export default function artplayerProxyWebAV() {
|
||||
videoWidth: 0,
|
||||
videoHeight: 0,
|
||||
currentTime: 0,
|
||||
volume: 1,
|
||||
autoplay: false,
|
||||
playbackRate: 1,
|
||||
paused: true,
|
||||
ended: false,
|
||||
readyState: 0,
|
||||
muted: false,
|
||||
buffered: 0,
|
||||
muted: option.muted,
|
||||
volume: option.volume,
|
||||
autoplay: option.autoplay,
|
||||
});
|
||||
}
|
||||
|
||||
@@ -63,6 +63,7 @@ export default 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