47 lines
1.2 KiB
Swift
47 lines
1.2 KiB
Swift
//
|
||
// video.swift
|
||
// vrtnu
|
||
//
|
||
// Created by Jens Timmerman on 24/09/2020.
|
||
//
|
||
|
||
/*
|
||
See LICENSE folder for this sample’s licensing information.
|
||
|
||
Abstract:
|
||
Video is a simple struct that provides the title, url, and timing information about the app's videos.
|
||
*/
|
||
|
||
//import UIKit
|
||
import AVFoundation
|
||
|
||
struct Video: Hashable {
|
||
|
||
let hlsUrl: URL
|
||
let title: String
|
||
let duration: TimeInterval
|
||
var resumeTime: TimeInterval
|
||
|
||
init(hlsUrl: URL, title: String, duration: TimeInterval, resumeTime: TimeInterval = 0) {
|
||
self.hlsUrl = hlsUrl
|
||
self.title = title
|
||
self.duration = duration
|
||
self.resumeTime = resumeTime
|
||
}
|
||
}
|
||
|
||
extension Video {
|
||
|
||
static func makeVideos() -> [Video] {
|
||
return [
|
||
Video(hlsUrl: URL(string: "https://remix-cf.lwc.vrtcdn.be/remix/ecd69313-4a39-4297-95b1-aede167725b7/remix.ism/.m3u8")!,
|
||
title: "best of dinges",
|
||
duration: 2946),
|
||
Video(hlsUrl: URL(string: "https://remix-cf.lwc.vrtcdn.be/remix/ecd69313-4a39-4297-95b1-aede167725b7/remix.ism/.m3u8")!,
|
||
title: "best of dinges 2",
|
||
duration: 2946),
|
||
|
||
]
|
||
}
|
||
}
|