Skip to content

Commit

Permalink
Cleanups: minor cleanups on server components
Browse files Browse the repository at this point in the history
  • Loading branch information
rtshkmr committed Aug 10, 2024
1 parent 8460446 commit 5def134
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 9 deletions.
1 change: 0 additions & 1 deletion lib/vyasa/medium/playback.ex
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ defmodule Vyasa.Medium.Playback do
played_at: nil,
# timestamps
paused_at: nil,
# seconds TODO: convert to ms to standardise w HTML players?
elapsed: 0
}
end
Expand Down
6 changes: 0 additions & 6 deletions lib/vyasa_web/components/audio_player.ex
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ defmodule VyasaWeb.AudioPlayer do

@impl true
def render(assigns) 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></audio>
Expand All @@ -31,11 +30,6 @@ defmodule VyasaWeb.AudioPlayer do
} = _assigns,
socket
) do
IO.inspect(
"TRACE: audio player notified by media bridge -- audio_player.ex with event = #{event}",
label: "checkpoint"
)

{:ok,
socket
|> assign(playback: playback)}
Expand Down
4 changes: 2 additions & 2 deletions lib/vyasa_web/live/media_live/media_bridge.ex
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ defmodule VyasaWeb.MediaLive.MediaBridge do
} =
socket
) do
# TODO: add case for updating playback on seek
# TODO: [refactor] add case for updating playback on seek
socket
|> assign(
playback:
Expand Down Expand Up @@ -124,7 +124,7 @@ defmodule VyasaWeb.MediaLive.MediaBridge do
%{playback | playing?: false, paused_at: now, elapsed: elapsed}
end

# TODO: merge with the other update playback functions
# TODO: [refactor] merge with the other update playback functions
defp update_playback_on_seek(socket, position_ms) do
%{
playback:
Expand Down

0 comments on commit 5def134

Please sign in to comment.