Skip to content

Commit

Permalink
Rm props-passing of playback via <audio/>
Browse files Browse the repository at this point in the history
Playback state is init @ point of events registration, via a new bridge now.
  • Loading branch information
rtshkmr committed Aug 9, 2024
1 parent d627c53 commit 26a1ae9
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 3 deletions.
2 changes: 0 additions & 2 deletions assets/js/hooks/audio_player.js
Original file line number Diff line number Diff line change
Expand Up @@ -132,13 +132,11 @@ AudioPlayer = {
},
handlePlayableState(e) {
console.log("TRACE HandlePlayableState", e);
const playback = JSON.parse(this?.player?.dataset?.playback);
// this.initMediaSession(playback);
},
// DEPRECATED: the state setting already happens at the point of loading, we don't need to listen to any metadata load event now now.
handleMetadataLoad(e) {
console.log("TRACE HandleMetadataLoad", e);
const playback = JSON.parse(this?.player?.dataset?.playback);
// this.initMediaSession(playback);
},
handlePlayPause() {
Expand Down
2 changes: 1 addition & 1 deletion lib/vyasa_web/components/audio_player.ex
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ defmodule VyasaWeb.AudioPlayer do
# TODO: remove the reliance on the playback prop passed here, it forces a remounting of the node, which is undesirable
~H"""
<div id="audio-player" phx-hook="AudioPlayer">
<audio data-playback={Jason.encode!(@playback)}></audio>
<audio></audio>
</div>
"""
end
Expand Down

0 comments on commit 26a1ae9

Please sign in to comment.