Allow mediaCast sender to run in background context

This commit is contained in:
hensm
2019-07-27 07:56:43 +01:00
parent 79fd72022b
commit 9e196465e5
12 changed files with 527 additions and 523 deletions

View File

@@ -1,7 +1,5 @@
"use strict";
import mediaCasting from "./mediaCasting";
import { stringify } from "./utils";
import { ReceiverSelection
@@ -45,8 +43,12 @@ export default async function loadSender (opts: LoadSenderOptions) {
case ReceiverSelectorMediaType.File: {
const fileUrl = new URL(`file://${opts.selection.filePath}`);
const mediaSession = await mediaCasting.loadMediaUrl(
fileUrl.href, opts.selection.receiver);
const { init } = await import("../senders/mediaCast");
init({
mediaUrl: fileUrl.href
, receiver: opts.selection.receiver
});
break;
}