Skip to content

Commit

Permalink
chore: added another test asset and removed stitching from default ex…
Browse files Browse the repository at this point in the history
…ample
  • Loading branch information
birme committed Aug 28, 2023
1 parent 8da9552 commit 4193927
Showing 1 changed file with 8 additions and 18 deletions.
26 changes: 8 additions & 18 deletions examples/default.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,6 @@ import { ChannelEngine, ChannelEngineOpts,
VodRequest, VodResponse, Channel, ChannelProfile
} from "../index";

const STITCH_ENDPOINT =
process.env.STITCH_ENDPOINT ||
"http://lambda.eyevinn.technology/stitch/master.m3u8";
class RefAssetManager implements IAssetManager {
private assets;
private pos;
Expand All @@ -18,18 +15,23 @@ class RefAssetManager implements IAssetManager {
1: [
{
id: 1,
title: "Streaming Tech TV+",
uri: "https://lab.cdn.eyevinn.technology/stswetvplus-promo-2023-5GBm231Mkz.mov/manifest.m3u8",
},
{
id: 2,
title: "Tears of Steel",
uri: "https://maitv-vod.lab.eyevinn.technology/tearsofsteel_4k.mov/master.m3u8",
},
{
id: 2,
id: 3,
title: "VINN",
uri: "https://maitv-vod.lab.eyevinn.technology/VINN.mp4/master.m3u8",
},
],
};
this.pos = {
1: 1,
1: 0,
};
}

Expand All @@ -50,22 +52,10 @@ class RefAssetManager implements IAssetManager {
if (this.pos[channelId] > this.assets[channelId].length - 1) {
this.pos[channelId] = 0;
}
const payload = {
uri: vod.uri,
breaks: [
{
pos: 100,
duration: 15 * 1000,
url: "https://maitv-vod.lab.eyevinn.technology/ads/6cd7d768_e214_4ebc_9f14_7ed89710115e_mp4/master.m3u8",
},
],
};
const buff = Buffer.from(JSON.stringify(payload));
const encodedPayload = buff.toString("base64");
const vodResponse = {
id: vod.id,
title: vod.title,
uri: STITCH_ENDPOINT + "?payload=" + encodedPayload,
uri: vod.uri,
};
resolve(vodResponse);
} else {
Expand Down

0 comments on commit 4193927

Please sign in to comment.