avplayer

I want to make a sound play starting from the 15th second [closed]

巧了我就是萌 提交于 2020-06-18 11:59:08
问题 Closed . This question needs details or clarity. It is not currently accepting answers. Want to improve this question? Add details and clarify the problem by editing this post. Closed 5 years ago . Improve this question I want to make a sound play starting from the 15th second. How can I do it programmatically? Thanks! 回答1: As I can understand you are trying to start your audio not from the beginning. In this case: You need to use seekToTime import UIKit import AVFoundation class

AVPlayer URL custom loading for HTTPS

倖福魔咒の 提交于 2020-06-17 09:14:30
问题 I'm trying to use AVPlayer with custom URL loading (a custom NSURLProtocol subclass). But it seems [NSURLProtocol registerClass] does not work with AVPlayer in real device (see this thread). Now I'm trying to use AVAssetResourceLoaderDelegate to do the custom URL loading. However it is a bit confusing to me how the delegate will be triggered. The URL I deal with looks like this https://some_ip_address:port/resource/ , but it seems like my delegate is not called for such URL. I tried to change

Video playback issues only on iOS 13 with AVPlayerViewController and AVPlayer when using HLS video

删除回忆录丶 提交于 2020-05-25 17:01:32
问题 I have an app that plays back videos. It's compatible with iOS 11, 12 and iOS 13. On iOS 11 and 12, video playback works properly as expected using either AVPlayerViewController or even just AVPlayerLayer . However, on iOS 13 I started getting reports that suddenly video wasn't loading (or would only load audio, or only the first frame) for quite a few users when they updated iOS. I had a really hard time replicating it, but some mentioned it occurred mostly with poor network connections, and

Video playback issues only on iOS 13 with AVPlayerViewController and AVPlayer when using HLS video

痞子三分冷 提交于 2020-05-25 16:57:18
问题 I have an app that plays back videos. It's compatible with iOS 11, 12 and iOS 13. On iOS 11 and 12, video playback works properly as expected using either AVPlayerViewController or even just AVPlayerLayer . However, on iOS 13 I started getting reports that suddenly video wasn't loading (or would only load audio, or only the first frame) for quite a few users when they updated iOS. I had a really hard time replicating it, but some mentioned it occurred mostly with poor network connections, and

Using seconds in AVPlayer seekToTime

我们两清 提交于 2020-05-25 06:35:18
问题 this should be a simple one. I have an AVPlayer playing a video file and I want to be able to jump to a specific time but I'm having some trouble understanding how CMTime works. I need to specify the time in seconds. For example: if I wanted to jump to second 10.8 I'd like to do something like this: [self.avPlayer.currentItem seekToTime:CMTimeMakeWithSeconds(10.8, 1]; But I'm not getting the result I want. 回答1: http://warrenmoore.net/understanding-cmtime Might give you a clearer idea of

Draw button on top of AVPlayer

做~自己de王妃 提交于 2020-04-29 06:21:51
问题 I have to draw a label or button on top of video relay next previous , leave comment . List of video have it, once user select one item from the table,it need to play, Once player play finished, those buttons or label should come on top of video Here is my code : comPlayerControl = AVPlayerViewController() if let player = comPlayerControl { let videoURL: String = "http://cdnapi.kaltura.com/p/11/sp/11/playManifest/entryId/"+selectedSubmission.transcodeRefId+"/format/applehttp/protocol/http/a

How to control AVPlayer in SwiftUI?

旧时模样 提交于 2020-04-17 23:01:48
问题 In my new SwiftUI project I have an AVPlayer for streaming music from url. Now I need to control the current time of playing track and the volume through sliders, here is the part of design: now I can control the player with UserData final class and its @Published vars, like isPlaying : final class UserData: ObservableObject { // ... @Published var player: AVPlayer? = nil @Published var isPlaying: Bool = false //... func playPausePlayer(withSong song: Song, forPlaylist playlist: [Song]?) { //

How to control AVPlayer in SwiftUI?

浪子不回头ぞ 提交于 2020-04-17 22:59:30
问题 In my new SwiftUI project I have an AVPlayer for streaming music from url. Now I need to control the current time of playing track and the volume through sliders, here is the part of design: now I can control the player with UserData final class and its @Published vars, like isPlaying : final class UserData: ObservableObject { // ... @Published var player: AVPlayer? = nil @Published var isPlaying: Bool = false //... func playPausePlayer(withSong song: Song, forPlaylist playlist: [Song]?) { //

How to control AVPlayer in SwiftUI?

[亡魂溺海] 提交于 2020-04-17 22:58:11
问题 In my new SwiftUI project I have an AVPlayer for streaming music from url. Now I need to control the current time of playing track and the volume through sliders, here is the part of design: now I can control the player with UserData final class and its @Published vars, like isPlaying : final class UserData: ObservableObject { // ... @Published var player: AVPlayer? = nil @Published var isPlaying: Bool = false //... func playPausePlayer(withSong song: Song, forPlaylist playlist: [Song]?) { //

AVPlayer doesn't play video until a video from UIImagePickerController is played

左心房为你撑大大i 提交于 2020-03-25 12:34:01
问题 I'm having a problem which I haven't seen a post like it on here. I have an AVPlayerViewController which plays a video based off the path from my Firebase Database (not Storage). The video plays perfectly as I want it to, but only once I watch a video that is clicked on in the UIImagePickerController elsewhere in the app. So for example, the AVPlayer will show a black background (this occurs with all of the AVPlayer's in the app), except for when I watch a video from the