Skip to content

Sync station pause/resume with subscribers#7

Open
foxy-eyed wants to merge 1 commit intoday-3from
feature/sync-track-state
Open

Sync station pause/resume with subscribers#7
foxy-eyed wants to merge 1 commit intoday-3from
feature/sync-track-state

Conversation

@foxy-eyed
Copy link
Copy Markdown
Owner

@foxy-eyed foxy-eyed commented Aug 1, 2023

Добавить возможность автору трансляции ставить проигрывание трека на паузу (и обратно) и синхронизировать эти действия со слушателями.

3z5SDDqOsZ

Copy link
Copy Markdown

@palkan palkan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Всё тут 🤘

Но пару вопросиков оставил.

@apply cursor-pointer;
}

.player-playing .player-btn[data-action="click->player#play"] {
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

А че не понравилось в предыдущем варианте?)

<% if live || !station %>
<div class="player--controls">
<span class="player-btn" data-action="click->player#play">
<%= button_to "#", method: :post, form: {class: "player-btn player-btn--play", data: {"turbo-command" => "PlayerCommand#resume"}} do %>
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

А почему бы не использовать <a>?

Comment on lines +38 to +42
turbo_stream.invoke(
"setAttribute",
args: ["data-player-is-playing-value", is_playing.to_s],
selector: "[data-controller='player']"
)
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Пожалуй, вот к этому я бы придрался — теперь локальное воспроизведение (в режиме не-радио) тоже контролируется сервером. А если учесть, что сервер на Рельсах, лаг между нажатием на кнопку и воспроизведением может быть заметен)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants