swift play video from url
import AVKit
import AVFoundation
class VideoController: UIViewController
override func viewDidLoad(){
guard let videoURL = URL(string: "VideoURL") else {
return
}
let player = AVPlayer(url: videoURL)
let playerViewController = AVPlayerViewController()
playerViewController.player = player
self.present(playerViewController, animated: true) {
playerViewController.player?.play()
}
}
Also in Swift:
- uitextfield placeholder text
- change the title of a button using Swift
- use timer swift
- swift ways to setup constraints
- swift stirng to date
- ternary operator swift
- swift 5 progress bar height
- swift how to sort array
- swift table view needs
- sprite kitYourNextScene
- swift double v float
- disable dark mode swift
- detect binding valu change swiftui
- swift animate a label ishidden
- how to get index path cell collection view from ui longpress gesture swift
- array of button listeners swift
- how can i find range of a string in another string swift
- how to change the font of buttons programmatically swift
- swift test if simulator
- xcode enable a button after a text field is filled
- format decimal place swift
- Decimal to Double conversion in Swift
- register page
- swift session.input