Fix JSON serialization

This commit is contained in:
Omar Roth
2020-03-29 17:44:45 -04:00
parent 0e58d99f4e
commit 3b2e142542
10 changed files with 76 additions and 56 deletions

View File

@@ -16,16 +16,18 @@
<body>
<script id="video_data" type="application/json">
<%=
{
"id": "<%= video.id %>",
"index": "<%= continuation %>",
"plid": "<%= plid %>",
"length_seconds": "<%= video.length_seconds.to_f %>",
"video_series": <%= video_series.to_json %>,
"params": <%= params.to_json %>,
"preferences": <%= preferences.to_json %>,
"premiere_timestamp": <%= video.premiere_timestamp.try &.to_unix || "null" %>
}
"id" => video.id,
"index" => continuation,
"plid" => plid,
"length_seconds" => video.length_seconds.to_f,
"video_series" => video_series,
"params" => params,
"preferences" => preferences,
"premiere_timestamp" => video.premiere_timestamp.try &.to_unix
}.to_pretty_json
%>
</script>
<%= rendered "components/player" %>