Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Explicitly fetch the video as a blob #24

Open
wants to merge 1 commit into
base: c2pa-dash
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions samples/c2pa/monolithic/c2pa-demo-monolithic.html
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,9 @@
/* c2pa player instance */
var c2paPlayer;

function init() {
async function init() {
var video,
url = "../../microsoft/video_samples/monolithic/provenanceoutput_progressivedownload.mp4";
url = "../../microsoft/video_samples/provenanceoutput_tearsOfSteel_flatfile_progressivedownload.mp4";

video = document.querySelector("#videoPlayer");

Expand All @@ -44,7 +44,10 @@
c2paPlayer.initialize();

/* Initialize native video element */
video.src = url;
const video_blob = await (await fetch(url)).blob();
const media_url = URL.createObjectURL(video_blob);

video.src = media_url;
video.type = 'video/mp4';

/* Once video is ready for playback, initialize c2pa plugin,
Expand Down