Skip to content

Commit bc2e4ad

Browse files
committed
Add mp4 support
1 parent 5e5a18b commit bc2e4ad

File tree

4 files changed

+33
-33
lines changed

4 files changed

+33
-33
lines changed

.DS_Store

0 Bytes
Binary file not shown.

src/.DS_Store

0 Bytes
Binary file not shown.

src/routes/dashboard/EpisodeEdit.svelte

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<script>
2-
import { navigate, Link } from "svelte-routing";
3-
import { TextField, TextAreaField, SelectField, MediaField } from "../forms";
4-
import Data from "../Data.svelte";
2+
import { navigate, Link } from 'svelte-routing';
3+
import { TextField, TextAreaField, SelectField, MediaField } from '../forms';
4+
import Data from '../Data.svelte';
55
export let episode;
66
export let dirty;
77
let confirmDelete = false;
@@ -27,7 +27,7 @@
2727
class="inline-block h-20 w-20 object-cover rounded-lg {!$episode
2828
.Show.picture && 'bg-white'}"
2929
src={$episode.Show.picture ??
30-
"https://cdn.freshair.radio/logos/FreshairBlackLogo.png"}
30+
'https://cdn.freshair.radio/logos/FreshairBlackLogo.png'}
3131
alt=""
3232
/>
3333
</div>
@@ -36,7 +36,7 @@
3636
{$episode.Show.title}
3737
</p>
3838
<p class="font-medium text-gray-200 text-md ">
39-
presented by {$episode.Show.meta.byline ?? ""}
39+
presented by {$episode.Show.meta.byline ?? ''}
4040
</p>
4141
</div>
4242
</div>
@@ -127,21 +127,21 @@
127127
label="Broadcast in week starting..."
128128
bind:value={$episode.scheduling.week}
129129
options={[
130-
"18th January",
131-
"25th January",
132-
"1st February",
133-
"8th February",
134-
"15th February",
135-
"22nd February",
136-
"1st March",
137-
"8th March",
138-
"15th March",
139-
"22nd March",
140-
"29th March",
141-
"5th April",
142-
"12th April",
143-
"19th April",
144-
"26th April"
130+
'18th January',
131+
'25th January',
132+
'1st February',
133+
'8th February',
134+
'15th February',
135+
'22nd February',
136+
'1st March',
137+
'8th March',
138+
'15th March',
139+
'22nd March',
140+
'29th March',
141+
'5th April',
142+
'12th April',
143+
'19th April',
144+
'26th April'
145145
]}
146146
/>
147147
<MediaField
@@ -152,7 +152,7 @@
152152
processedValue={$episode.meta.published !== false && $episode.meta}
153153
label="Episode audio"
154154
class="col-span-6"
155-
ct="audio/mpeg,audio/mp3"
155+
ct="audio/mpeg,audio/mp3,audio/m4a,audio/x-m4a"
156156
/>
157157
</dl>
158158
</div>

src/routes/forms/UploadProgress.svelte

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<script>
2-
import { onMount, createEventDispatcher, onDestroy } from "svelte";
2+
import { onMount, createEventDispatcher, onDestroy } from 'svelte';
33
const dispatch = createEventDispatcher();
44
55
let ws;
@@ -21,12 +21,12 @@
2121
let done = false;
2222
const setupProgressListening = (url) => {
2323
processing = true;
24-
ws = new WebSocket("wss://ws.freshair.radio");
24+
ws = new WebSocket('wss://ws.freshair.radio');
2525
ws.onmessage = (m) => {
2626
const data = JSON.parse(m.data);
27-
if (data.type == "processingUpdate" && url == data.for) {
27+
if (data.type == 'processingUpdate' && url == data.for) {
2828
processingPercentage = Math.round(data.progress);
29-
} else if (data.type == "processingDone" && url == data.for) {
29+
} else if (data.type == 'processingDone' && url == data.for) {
3030
done = true;
3131
}
3232
console.log(data);
@@ -36,7 +36,7 @@
3636
const reader = new FileReader();
3737
const xhr = new XMLHttpRequest();
3838
xhr.upload.addEventListener(
39-
"progress",
39+
'progress',
4040
(e) => {
4141
if (e.lengthComputable) {
4242
percentage = Math.round((e.loaded * 100) / e.total);
@@ -47,20 +47,20 @@
4747
);
4848
4949
xhr.upload.addEventListener(
50-
"load",
50+
'load',
5151
(e) => {
5252
percentage = 100;
53-
dispatch("uploaded", signed);
53+
dispatch('uploaded', signed);
5454
if (process) {
5555
setupProgressListening(signed.access);
5656
}
5757
},
5858
false
5959
);
60-
xhr.open("PUT", signed.signed);
61-
xhr.setRequestHeader("x-amz-acl", "public-read");
62-
xhr.setRequestHeader("Content-Type", "audio/mpeg");
63-
xhr.overrideMimeType("audio/mpeg");
60+
xhr.open('PUT', signed.signed);
61+
xhr.setRequestHeader('x-amz-acl', 'public-read');
62+
xhr.setRequestHeader('Content-Type', signed.mime);
63+
xhr.overrideMimeType(signed.mime);
6464
reader.onload = (evt) => {
6565
xhr.send(evt.target.result);
6666
};
@@ -138,7 +138,7 @@
138138
{#if done}
139139
Uploaded
140140
{:else if processing}
141-
{processingPercentage == 0 ? "Processing..." : `${processingPercentage}%`}
141+
{processingPercentage == 0 ? 'Processing...' : `${processingPercentage}%`}
142142
{:else}
143143
{percentage}%
144144
{/if}

0 commit comments

Comments
 (0)