Last active
March 3, 2019 03:55
-
-
Save xjbeta/cbe0d9704e60f3ed599da95e6d262f4d to your computer and use it in GitHub Desktop.
IINA 'iina://' example.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Cocoa | |
var urlQueryValueAllowed: CharacterSet = { | |
let generalDelimitersToEncode = ":#[]@?/" // does not include "?" or "/" due to RFC 3986 - Section 3.4 | |
let subDelimitersToEncode = "!$&'()*+,;=" | |
var allowed = CharacterSet.urlQueryAllowed | |
allowed.remove(charactersIn: generalDelimitersToEncode + subDelimitersToEncode) | |
return allowed | |
}() | |
let videoUrl = "/test/test.webm".addingPercentEncoding(withAllowedCharacters: urlQueryValueAllowed)! | |
let audioUrl = "/test/test.m4a".addingPercentEncoding(withAllowedCharacters: urlQueryValueAllowed)! | |
let iinaUrl = "iina://open?url=\(videoUrl)&mpv_audio-file=\(audioUrl)" | |
print(iinaUrl) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment