By looking at the answers in this question and seeing this PR, I understand why amp-stories are mute by default. But I want to try and unmute it as soon as the story loads.
Maybe by calling the same function that unmutes the story on tapping the sound button on top right corner ? Just instead of on 'click', I will call it on 'load'.
In amp-story-system-layer.js
, this function initializeListeners_()
initializes everything, and if I import these scripts on my page, I'm guessing something like this can work :
<script>
window.addEventListener('load', function() {
isMuted = false;
this.storeService_.subscribe(
StateProperty.MUTED_STATE,
(isMuted) => {
this.onMutedStateUpdate_(isMuted);
},
true
);
});
</script>
Any ideas? Is this the right direction? (I'm a beginner in javascript)
Thanks