default volume to 80% (≈ -2dB)

This commit is contained in:
Charlotte Som 2025-06-05 01:25:22 +01:00
parent efffc976d1
commit aa0f0885f9

View file

@ -39,8 +39,10 @@ const resolveVideoURL = async (did: string, blob: string): Promise<string> => {
method: "POST",
headers: { "content-encoding": "application/json" },
body: JSON.stringify({ repo: did, blob }),
}).then((r) => r.json());
return `/user-content/${res.filename}`;
});
if (res.status !== 200) throw new Error("got error fetching video cdn url");
const data = await res.json();
return `/user-content/${data.filename}`;
};
const main = async () => {
@ -55,21 +57,23 @@ const main = async () => {
const did = repo.startsWith("did:") ? repo : await resolveHandle(repo);
const video = await fetchVideoRecord(did, rkey);
const videoURL = await resolveVideoURL(did, video.video.ref.$link);
player.append(
const record = await fetchVideoRecord(did, rkey);
const videoURL = await resolveVideoURL(did, record.video.ref.$link);
const video = (
<video crossOrigin="anonymous" controls>
<source src={videoURL} />
</video>
);
) as HTMLVideoElement;
video.volume = 0.8;
if (video.title) {
player.append(<h1>{video.title}</h1>);
document.title = `${video.title} | video.cerulea.blue`;
player.append(video);
if (record.title) {
player.append(<h1>{record.title}</h1>);
document.title = `${record.title} | video.cerulea.blue`;
}
if (video.description)
player.append(<p className="description">{video.description}</p>);
if (record.description)
player.append(<p className="description">{record.description}</p>);
};
main();