🐛 [Story mediapool] Unmute mediapool swap#38208
🐛 [Story mediapool] Unmute mediapool swap#38208mszylkowski merged 35 commits intoampproject:mainfrom
Conversation
…of github.com:ampproject/amphtml
|
Hey @gmajoulet, @newmuis! These files were changed: |
jridgewell
left a comment
There was a problem hiding this comment.
Can we just disconnect the gain node when going to a new video? We could reuse/reconnect the gain if needed.
Good suggestion. If you specifically mean the GainNode->AudioContext.destination connection, we technically can disconnect and reconnect it multiple times, I don't know how much performance we're leaving on the table by keeping these nodes connected though. I'd make this a followup PR if we want since it adds some more logic (I'd do it on mute/unmute, connect or disconnect the gain node of a video if it uses the audio graph). We'd also want to check what connection is best to break (or both): MediaSourceElementNode->GainNode or GainNode->AudioContext.destination. This wouldn't replace the fix on this PR. |
Fixes #38206
Changes
volume=0.5), only once per video max.noaudioattr orvolume=0), we just keep the video muted (we don't run theUnmuteTask).GainNode.gain.value = 1).Known issues (will be documented):
When a video on a story has
volume=x(0<x<1) that source will use gainNodes to implement the volume, which can be reused on other videos. All videos on the story need to have thecrossoriginattribute if they come from other origins (due to CORS), and will need ACAO headers as necessary.