Skip to content

Commit 798ceff

Browse files
committed
Expose the HLS playlist link on recordings
Regenerate the OpenAPI client so a recording carries its hls url once the playlist is uploaded, None until then.
1 parent 58badab commit 798ceff

12 files changed

Lines changed: 157 additions & 3 deletions

File tree

‎fishjam/_fishjam_openapi_client/api/mo_q/create_moq_access.py‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,11 @@ def _parse_response(
4949

5050
return response_401
5151

52+
if response.status_code == 402:
53+
response_402 = Error.from_dict(response.json())
54+
55+
return response_402
56+
5257
if response.status_code == 503:
5358
response_503 = Error.from_dict(response.json())
5459

‎fishjam/_fishjam_openapi_client/api/rooms/refresh_token.py‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ def _get_kwargs(
1515
room_id: str,
1616
id: str,
1717
) -> dict[str, Any]:
18+
1819
_kwargs: dict[str, Any] = {
1920
"method": "post",
2021
"url": "/room/{room_id}/peer/{id}/refresh_token".format(
@@ -44,6 +45,11 @@ def _parse_response(
4445

4546
return response_401
4647

48+
if response.status_code == 402:
49+
response_402 = Error.from_dict(response.json())
50+
51+
return response_402
52+
4753
if response.status_code == 404:
4854
response_404 = Error.from_dict(response.json())
4955

‎fishjam/_fishjam_openapi_client/api/streamers/create_streamer.py‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
def _get_kwargs(
1515
stream_id: str,
1616
) -> dict[str, Any]:
17+
1718
_kwargs: dict[str, Any] = {
1819
"method": "post",
1920
"url": "/livestream/{stream_id}/streamer".format(
@@ -37,6 +38,11 @@ def _parse_response(
3738

3839
return response_401
3940

41+
if response.status_code == 402:
42+
response_402 = Error.from_dict(response.json())
43+
44+
return response_402
45+
4046
if response.status_code == 404:
4147
response_404 = Error.from_dict(response.json())
4248

‎fishjam/_fishjam_openapi_client/api/streamers/generate_streamer_token.py‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
def _get_kwargs(
1515
room_id: str,
1616
) -> dict[str, Any]:
17+
1718
_kwargs: dict[str, Any] = {
1819
"method": "post",
1920
"url": "/room/{room_id}/streamer".format(
@@ -42,6 +43,11 @@ def _parse_response(
4243

4344
return response_401
4445

46+
if response.status_code == 402:
47+
response_402 = Error.from_dict(response.json())
48+
49+
return response_402
50+
4551
if response.status_code == 404:
4652
response_404 = Error.from_dict(response.json())
4753

‎fishjam/_fishjam_openapi_client/api/viewers/create_viewer.py‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
def _get_kwargs(
1515
stream_id: str,
1616
) -> dict[str, Any]:
17+
1718
_kwargs: dict[str, Any] = {
1819
"method": "post",
1920
"url": "/livestream/{stream_id}/viewer".format(
@@ -37,6 +38,11 @@ def _parse_response(
3738

3839
return response_401
3940

41+
if response.status_code == 402:
42+
response_402 = Error.from_dict(response.json())
43+
44+
return response_402
45+
4046
if response.status_code == 404:
4147
response_404 = Error.from_dict(response.json())
4248

‎fishjam/_fishjam_openapi_client/api/viewers/generate_viewer_token.py‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
def _get_kwargs(
1515
room_id: str,
1616
) -> dict[str, Any]:
17+
1718
_kwargs: dict[str, Any] = {
1819
"method": "post",
1920
"url": "/room/{room_id}/viewer".format(
@@ -42,6 +43,11 @@ def _parse_response(
4243

4344
return response_401
4445

46+
if response.status_code == 402:
47+
response_402 = Error.from_dict(response.json())
48+
49+
return response_402
50+
4551
if response.status_code == 404:
4652
response_404 = Error.from_dict(response.json())
4753

‎fishjam/_fishjam_openapi_client/models/__init__.py‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@
3232
from .recording_config_metadata_type_0 import RecordingConfigMetadataType0
3333
from .recording_details_response import RecordingDetailsResponse
3434
from .recording_file import RecordingFile
35+
from .recording_hls_type_0 import RecordingHlsType0
3536
from .recording_list_response import RecordingListResponse
3637
from .recording_metadata_type_0 import RecordingMetadataType0
3738
from .recording_status import RecordingStatus
@@ -99,6 +100,7 @@
99100
"RecordingConfigMetadataType0",
100101
"RecordingDetailsResponse",
101102
"RecordingFile",
103+
"RecordingHlsType0",
102104
"RecordingListResponse",
103105
"RecordingMetadataType0",
104106
"RecordingStatus",

‎fishjam/_fishjam_openapi_client/models/moq_access.py‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,9 @@ class MoqAccess:
1414
"""Connection details for a MoQ relay client
1515
1616
Attributes:
17-
connection_url (str): Relay connection URL with the JWT embedded as a `?jwt=` query parameter. Pass directly to
18-
a MoQ client SDK. Example: https://relay.fishjam.io/abc123?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9....
17+
connection_url (str): Relay connection URL scoped to the tenant UUID, with the JWT embedded as a `?jwt=` query
18+
parameter. Pass directly to a MoQ client SDK. Example:
19+
https://relay.fishjam.io/abc123?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9....
1920
token (str): JWT authorizing the MoQ relay connection, also embedded in `connection_url` Example: eyJhbGciOiJIUz
2021
I1NiIsInR5cCI6IkpXVCJ9.eyJyb290IjoiZmlzaGphbSIsInB1dCI6WyJteS1zdHJlYW0iXSwiZ2V0IjpbXSwiaWF0IjoxNzEzMzYwMDAwLCJle
2122
HAiOjE3MTMzNjM2MDB9.abc123.

‎fishjam/_fishjam_openapi_client/models/moq_access_config.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ class MoqAccessConfig:
1919
subscribe_path (None | str | Unset): Path under the root the token grants subscribe access to Example: my-
2020
stream.
2121
ttl (int | None | Unset): Token time to live in seconds. Defaults to 3600 (1 hour), maximum is 604800 (7 days).
22-
Example: 3600.
22+
On the free tier the maximum is 3600 (1 hour). Example: 3600.
2323
"""
2424

2525
publish_path: None | str | Unset = UNSET

‎fishjam/_fishjam_openapi_client/models/recording.py‎

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
if TYPE_CHECKING:
1313
from ..models.composition_source import CompositionSource
1414
from ..models.recording_file import RecordingFile
15+
from ..models.recording_hls_type_0 import RecordingHlsType0
1516
from ..models.recording_metadata_type_0 import RecordingMetadataType0
1617
from ..models.template_source import TemplateSource
1718

@@ -26,6 +27,8 @@ class Recording:
2627
Attributes:
2728
files (list[RecordingFile]): Media files of the recording, in playback order. Empty until the recording is
2829
`available`.
30+
hls (None | RecordingHlsType0): HLS playlist of the recording, playable while it is still `active`. Null until
31+
the playlist reaches the delivery bucket.
2932
id (str): Assigned recording id
3033
source (CompositionSource | TemplateSource): The source for the recording
3134
status (RecordingStatus): Lifecycle status of a recording
@@ -34,6 +37,7 @@ class Recording:
3437
"""
3538

3639
files: list[RecordingFile]
40+
hls: None | RecordingHlsType0
3741
id: str
3842
source: CompositionSource | TemplateSource
3943
status: RecordingStatus
@@ -42,13 +46,20 @@ class Recording:
4246

4347
def to_dict(self) -> dict[str, Any]:
4448
from ..models.composition_source import CompositionSource
49+
from ..models.recording_hls_type_0 import RecordingHlsType0
4550
from ..models.recording_metadata_type_0 import RecordingMetadataType0
4651

4752
files = []
4853
for files_item_data in self.files:
4954
files_item = files_item_data.to_dict()
5055
files.append(files_item)
5156

57+
hls: dict[str, Any] | None
58+
if isinstance(self.hls, RecordingHlsType0):
59+
hls = self.hls.to_dict()
60+
else:
61+
hls = self.hls
62+
5263
id = self.id
5364

5465
source: dict[str, Any]
@@ -71,6 +82,7 @@ def to_dict(self) -> dict[str, Any]:
7182
field_dict.update(self.additional_properties)
7283
field_dict.update({
7384
"files": files,
85+
"hls": hls,
7486
"id": id,
7587
"source": source,
7688
"status": status,
@@ -84,6 +96,7 @@ def to_dict(self) -> dict[str, Any]:
8496
def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
8597
from ..models.composition_source import CompositionSource
8698
from ..models.recording_file import RecordingFile
99+
from ..models.recording_hls_type_0 import RecordingHlsType0
87100
from ..models.recording_metadata_type_0 import RecordingMetadataType0
88101
from ..models.template_source import TemplateSource
89102

@@ -95,6 +108,21 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
95108

96109
files.append(files_item)
97110

111+
def _parse_hls(data: object) -> None | RecordingHlsType0:
112+
if data is None:
113+
return data
114+
try:
115+
if not isinstance(data, dict):
116+
raise TypeError()
117+
hls_type_0 = RecordingHlsType0.from_dict(data)
118+
119+
return hls_type_0
120+
except (TypeError, ValueError, AttributeError, KeyError):
121+
pass
122+
return cast(None | RecordingHlsType0, data)
123+
124+
hls = _parse_hls(d.pop("hls"))
125+
98126
id = d.pop("id")
99127

100128
def _parse_source(data: object) -> CompositionSource | TemplateSource:
@@ -137,6 +165,7 @@ def _parse_metadata(data: object) -> None | RecordingMetadataType0 | Unset:
137165

138166
recording = cls(
139167
files=files,
168+
hls=hls,
140169
id=id,
141170
source=source,
142171
status=status,

0 commit comments

Comments
 (0)