| 49 | static decodeSync = Schema.decodeSync(Video); |
| 50 | |
| 51 | static getSource(self: Video) { |
| 52 | if (self.source.type === "MediaConvert") |
| 53 | return new M3U8Source({ |
| 54 | videoId: self.id, |
| 55 | ownerId: self.ownerId, |
| 56 | subpath: "output/video_recording_000.m3u8", |
| 57 | }); |
| 58 | |
| 59 | if (self.source.type === "local") |
| 60 | return new M3U8Source({ |
| 61 | videoId: self.id, |
| 62 | ownerId: self.ownerId, |
| 63 | subpath: "combined-source/stream.m3u8", |
| 64 | }); |
| 65 | |
| 66 | if (self.source.type === "desktopSegments") |
| 67 | return new SegmentsSource({ videoId: self.id, ownerId: self.ownerId }); |
| 68 | |
| 69 | if (self.source.type === "desktopMP4" || self.source.type === "webMP4") |
| 70 | return new Mp4Source({ videoId: self.id, ownerId: self.ownerId }); |
| 71 | } |
| 72 | } |
| 73 | |
| 74 | export const UploadPhase = Schema.Literal( |