Skip to content

Commit c1c1aa4

Browse files
committed
Merge branch 'develop'
2 parents 663180d + 0a0b154 commit c1c1aa4

File tree

12 files changed

+139
-36
lines changed

12 files changed

+139
-36
lines changed

README.md

Lines changed: 22 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -2,43 +2,48 @@
22

33
__asciinema server__ is a server-side component of the asciinema ecosystem.
44

5-
It implements a hosting platform for terminal session recordings. This includes
6-
an API endpoint for uploading recordings, which is used by the [asciinema
7-
CLI](https://docs.asciinema.org/manual/cli/), and offers a familiar web
8-
interface for viewing, browsing, sharing and managing recordings.
5+
It implements a hosting platform for terminal session recordings and live
6+
streaming. It offers a familiar web interface for viewing, browsing, sharing
7+
and managing recordings and streams. This includes [HTTP
8+
API](https://docs.asciinema.org/manual/server/api.md), which is used by the
9+
[asciinema CLI](https://docs.asciinema.org/manual/cli/index.md).
910

1011
The server is built with [Elixir language](https://elixir-lang.org/) and
11-
[Phoenix framework](https://www.phoenixframework.org/), and embeds asciinema's
12-
virtual terminal, [avt](https://github.com/asciinema/avt), to perform tasks such
13-
as preview generation and recording analysis.
12+
[Phoenix framework](https://www.phoenixframework.org/). It embeds asciinema's
13+
virtual terminal, [avt](https://github.com/asciinema/avt), which is utilized by
14+
tasks such as preview generation, recording analysis and live stream state
15+
bookkeeping.
1416

1517
[asciinema.org](https://asciinema.org) is a public asciinema server instance
16-
managed by the asciinema team, offering free hosting for terminal recordings,
17-
available to everyone. Check [asciinema.org/about](https://asciinema.org/about)
18-
to learn more about this instance.
18+
managed by the asciinema project team, providing free hosting for terminal
19+
recordings and streams, available to everyone. Check
20+
[asciinema.org/about](https://asciinema.org/about) to learn more about this
21+
instance.
1922

2023
You can easily [self-host asciinema
21-
server](https://docs.asciinema.org/manual/server/self-hosting/) and use the
22-
[asciinema CLI](https://docs.asciinema.org/manual/cli/) with your own instance.
23-
If you're not comfortable with uploading your terminal sessions to
24+
server](https://docs.asciinema.org/manual/server/self-hosting/index.md) and use
25+
the [asciinema CLI](https://docs.asciinema.org/manual/cli/index.md) with your
26+
own instance. If you're not comfortable with hosting your data at
2427
asciinema.org, if your company policy prevents you from doing so, or if you
2528
simply prefer self-hosting everything, then asciinema has you covered.
2629

2730
Notable features:
2831

2932
- hosting of terminal session recordings in
30-
[asciicast](https://docs.asciinema.org/manual/asciicast/v2/) format,
33+
[asciicast](https://docs.asciinema.org/manual/asciicast/v3/) format,
34+
- [live streaming](https://docs.asciinema.org/manual/server/streaming/) of
35+
terminal sessions,
3136
- perfectly integrated [asciinema
3237
player](https://docs.asciinema.org/manual/player/) for best viewing experience,
3338
- easy [sharing](https://docs.asciinema.org/manual/server/sharing/) of
3439
recordings via secret links,
3540
- easy [embedding](https://docs.asciinema.org/manual/server/embedding/) of the
3641
player, or linking via preview images (SVG),
3742
- privacy friendly - no tracking, no ads,
38-
- visibility control for recordings: private, unlisted, or public,
39-
- editable recording metadata like title or long description (Markdown),
43+
- visibility control for recordings and streams: private, unlisted, or public,
44+
- editable recording/stream metadata like title or long description (Markdown),
4045
- configurable terminal themes and font families,
41-
- ability to download plain text version (`.txt`) of a recording.
46+
- download of plain text transcripts (`.txt`) of a recordings.
4247

4348
Refer to [asciinema server docs](https://docs.asciinema.org/manual/server/) for
4449
further details.

assets/css/_base.css

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,7 @@ body pre {
198198
margin-bottom: 1rem;
199199
}
200200

201-
.has-error .form-control {
201+
.has-error .form-control, input[type="url"]:invalid {
202202
border-color: #dc3545;
203203
box-shadow: inset 0 1px 1px rgba(0,0,0,.075);
204204
}
@@ -216,4 +216,4 @@ body pre {
216216

217217
span.email b {
218218
display: none;
219-
}
219+
}

assets/package-lock.json

Lines changed: 53 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

assets/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"defaults"
77
],
88
"dependencies": {
9-
"asciinema-player": "3.10.0",
9+
"asciinema-player": "3.12.1",
1010
"bootstrap": "^4.5.0",
1111
"jquery": "^3.5.1",
1212
"phoenix": "1.7.6",

justfile

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
default: serve
2+
3+
serve:
4+
iex -S mix phx.server
5+
6+
test:
7+
mix test
8+
9+
format:
10+
mix format

lib/asciinema_web/controllers/recording_controller.ex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@ defmodule AsciinemaWeb.RecordingController do
185185

186186
def edit(conn, _params) do
187187
changeset = Recordings.change_asciicast(conn.assigns.asciicast)
188-
render(conn, "edit.html", changeset: changeset)
188+
render(conn, "edit.html", changeset: changeset, instance_url: AsciinemaWeb.Endpoint.url())
189189
end
190190

191191
def update(conn, %{"asciicast" => asciicast_params}) do

lib/asciinema_web/controllers/recording_html.ex

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,8 @@ defmodule AsciinemaWeb.RecordingHTML do
3030
poster: poster(asciicast.snapshot),
3131
markers: markers(asciicast.markers),
3232
idleTimeLimit: asciicast.idle_time_limit,
33-
speed: asciicast.speed
33+
speed: asciicast.speed,
34+
audioUrl: asciicast.audio_url
3435
]
3536
|> Keyword.merge(opts)
3637
|> Ext.Keyword.rename(t: :startAt)

lib/asciinema_web/controllers/recording_html/edit.html.heex

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -223,6 +223,22 @@
223223
</div>
224224
</div>
225225

226+
<div class="form-group row">
227+
<.label for={f[:audio_url]} class="col-sm-4 col-md-3 col-lg-3 col-form-label">
228+
Audio URL
229+
</.label>
230+
<div class="col-sm-8 col-md-9 col-lg-9">
231+
<.input field={f[:audio_url]} type="url" class="form-control" />
232+
<.error field={f[:audio_url]} />
233+
<small class="form-text text-muted">
234+
Use it when you want to add a voice-over or a soundtrack to your
235+
recording. The player will automatically sync audio playback
236+
position with the terminal recording. The server providing the
237+
audio file must be configured to allow CORS requests from {@instance_url}.
238+
</small>
239+
</div>
240+
</div>
241+
226242
<div class="form-group row">
227243
<.label for={f[:markers]} class="col-sm-4 col-md-3 col-lg-3 col-form-label">
228244
Markers

lib/asciinema_web/controllers/stream_controller.ex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ defmodule AsciinemaWeb.StreamController do
7979
end
8080

8181
changeset = Streaming.change_stream(conn.assigns.stream)
82-
render(conn, :edit, changeset: changeset)
82+
render(conn, :edit, changeset: changeset, instance_url: AsciinemaWeb.Endpoint.url())
8383
end
8484

8585
def update(conn, %{"stream" => params}) do

lib/asciinema_web/controllers/stream_html.ex

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,11 @@ defmodule AsciinemaWeb.StreamHTML do
2626
[
2727
cols: term_cols(stream),
2828
rows: term_rows(stream),
29-
autoplay: true,
29+
autoplay: stream.audio_url == nil,
3030
theme: term_theme_name(stream),
3131
terminalLineHeight: stream.term_line_height,
32-
customTerminalFontFamily: Media.font_family(stream)
32+
customTerminalFontFamily: Media.font_family(stream),
33+
audioUrl: stream.audio_url
3334
]
3435
|> Keyword.merge(opts)
3536
|> Enum.into(%{})

0 commit comments

Comments
 (0)