PCRE не поддерживает синтаксис \uXXXX
. Вместо этого используйте \x{XXXX}
. См. здесь .
Ваш диапазон \u2e80-\u9fff
также эквивалентен
\p{InCJK_Radicals_Supplement}\p{InKangxi_Radicals}\p{InIdeographic_Description_Characters}\p{InCJK_Symbols_and_Punctuation}\p{InHiragana}\p{InKatakana}\p{InBopomofo}\p{InHangul_Compatibility_Jamo}\p{InKanbun}\p{InBopomofo_Extended}\p{InKatakana_Phonetic_Extensions}\p{InEnclosed_CJK_Letters_and_Months}\p{InCJK_Compatibility}\p{InCJK_Unified_Ideographs_Extension_A}\p{InYijing_Hexagram_Symbols}\p{InCJK_Unified_Ideographs}
Не забудьте добавить u
(/regex here/u
), если вы имеете дело с UTF-8. Если вы имеете дело с другой многобайтовой кодировкой, вы должны сначала преобразовать в UTF-8.
let videoUrl = //URL: Your Video URL
//Create player first using your URL
let yourplayer = AVPlayer(url: videoUrl)
//Create player controller and set it’s player
let playerController = AVPlayerViewController()
playerController.player = yourplayer
//Final step To present controller with player in your view controller
present(playerController, animated: true, completion: {
playerController.player!.play()
})
Swift 5
@IBAction func buttonPressed(_ sender: Any) {
let videoURL = course.introductionVideoURL
let player = AVPlayer(url: videoURL)
let playerViewController = AVPlayerViewController()
playerViewController.player = player
present(playerViewController, animated: true, completion: {
playerViewController.player!.play()
})
//здесь курс включает образцовый файл, в нем я дал URL, таким образом, я вызываю функцию из модели с помощью функции курса.
//также introductionVideoUrl является URL, который я объявил внутреннюю модель.
var introductionVideoURL: URL
Также альтернативно можно использовать ниже кода вместо того, чтобы вызвать функцию от Замены модели
этот код
let videoURL = course.introductionVideoURL
с [1 110]
guard let videoURL = URL(string: "https://something.mp4) else {
return