running:
bash create-vod-hls.sh beach.mkv
will produce:
beach/
|- playlist.m3u8
|- 360p.m3u8
// | |
// DebugDevice.swift | |
// | |
// Copyright 2022 • Sidetrack Tech Limited | |
// | |
import Foundation | |
// This must be called on the main-thread. | |
var isDebugProfileInstalled: Bool { |
import UIKit | |
extension UIView { | |
var allSubviews: [UIView] { | |
subviews + subviews.flatMap { $0.allSubviews } | |
} | |
func firstSubview<T: UIView>(of type: T.Type) -> T? { | |
allSubviews.first { $0 is T } as? T |
/** | |
* MacEditorTextView | |
* Copyright (c) Thiago Holanda 2020-2021 | |
* https://twitter.com/tholanda | |
* | |
* MIT license | |
*/ | |
import Combine | |
import SwiftUI |
running:
bash create-vod-hls.sh beach.mkv
will produce:
beach/
|- playlist.m3u8
|- 360p.m3u8
extension UITableView { | |
func autoSizeHeaderAndFooter() { | |
let width = self.bounds.width | |
let autoSize = { (view: UIView) in | |
view.translatesAutoresizingMaskIntoConstraints = false | |
let widthConstraint = NSLayoutConstraint(item: view, | |
attribute: NSLayoutAttribute.width, | |
relatedBy: NSLayoutRelation.equal, | |
toItem: nil, |
Direct copy of pre-encoded file:
$ ffmpeg -i filename.mp4 -codec: copy -start_number 0 -hls_time 10 -hls_list_size 0 -f hls filename.m3u8
let API_HEADER_FIELD_NONE_MATCH : String = "If-None-Match" | |
let API_HEADER_FIELD_ETAG : String = "Etag" | |
let API_REQUEST_SUCCESS : Int = 200 | |
func ETagForURL(urlString: String) -> String? { | |
// return the saved ETag value for the given URL | |
return NSUserDefaults.standardUserDefaults().objectForKey(urlString) as String? | |
} | |