AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |
Back to Blog
Video viewer tutorial3/14/2024 This will be drawn below the system video controls, but can respond to any events that aren’t caught by those controls. If you want, you can provide a second parameter to the VideoPlayer initializer that adds content to be drawn over the video. In android by using videoview and mediacontroller we can create video player app with play, pause, stop, etc. Reminder: You need to add import AVKit to your Swift file to use this.Īnd if you want to play a remote video, use its remote URL instead: VideoPlayer(player: AVPlayer(url: URL(string: "")!)) It comes from the AVKit framework, so you should make sure and add import AVKit before trying it out.Īs an example, if you had video.mp4 in your app bundle and wanted to play it back, you’d use this: VideoPlayer(player: AVPlayer(url: (forResource: "video", withExtension: "mp4")!)) SwiftUI’s VideoPlayer view lets us playback movies from any URL, local or remote.
0 Comments
Read More
Leave a Reply. |