Skip to content

Commit

Permalink
Use short public stream token in the command in streaming instructions
Browse files Browse the repository at this point in the history
  • Loading branch information
ku1ik committed Apr 10, 2024
1 parent 3aa9476 commit 1ef3d97
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion lib/asciinema_web/controllers/live_stream/show.html.heex
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@
name="rec-cmd-asciinema-streamer"
data-behavior="auto-select"
readonly
value={"asciinema stream -f #{ws_producer_url(@stream)}"}
value={"asciinema stream -f #{short_public_token(@stream)}"}
/>

<h3>
Expand Down
4 changes: 4 additions & 0 deletions lib/asciinema_web/controllers/live_stream_html.ex
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,10 @@ defmodule AsciinemaWeb.LiveStreamHTML do
end
end

defp short_public_token(stream) do
String.slice(stream.public_token, 0, 4)
end

def cinema_height(stream) do
MediaView.cinema_height(cols(stream), rows(stream))
end
Expand Down

0 comments on commit 1ef3d97

Please sign in to comment.