avplayer

Buffer size for AVPlayer / AVPlayerItem

耗尽温柔 提交于 2021-02-05 13:11:36
问题 I'm creating a streaming radio application for iOS and I would like to tweak the properties of AVPlayer and AVPlayerItem to give me more reliable playback in lossy connectivity conditions. I would like to increase the buffersize. The only answer I could find is here Is there anyway to achieve this without going to OpenAL? 回答1: Add the below piece of code in your observer method. NSArray *timeRanges = (NSArray *)[change objectForKey:NSKeyValueChangeNewKey]; CMTimeRange timerange = [timeRanges

Buffer size for AVPlayer / AVPlayerItem

寵の児 提交于 2021-02-05 13:11:27
问题 I'm creating a streaming radio application for iOS and I would like to tweak the properties of AVPlayer and AVPlayerItem to give me more reliable playback in lossy connectivity conditions. I would like to increase the buffersize. The only answer I could find is here Is there anyway to achieve this without going to OpenAL? 回答1: Add the below piece of code in your observer method. NSArray *timeRanges = (NSArray *)[change objectForKey:NSKeyValueChangeNewKey]; CMTimeRange timerange = [timeRanges

Buffer size for AVPlayer / AVPlayerItem

那年仲夏 提交于 2021-02-05 13:10:39
问题 I'm creating a streaming radio application for iOS and I would like to tweak the properties of AVPlayer and AVPlayerItem to give me more reliable playback in lossy connectivity conditions. I would like to increase the buffersize. The only answer I could find is here Is there anyway to achieve this without going to OpenAL? 回答1: Add the below piece of code in your observer method. NSArray *timeRanges = (NSArray *)[change objectForKey:NSKeyValueChangeNewKey]; CMTimeRange timerange = [timeRanges

Buffer size for AVPlayer / AVPlayerItem

百般思念 提交于 2021-02-05 13:10:00
问题 I'm creating a streaming radio application for iOS and I would like to tweak the properties of AVPlayer and AVPlayerItem to give me more reliable playback in lossy connectivity conditions. I would like to increase the buffersize. The only answer I could find is here Is there anyway to achieve this without going to OpenAL? 回答1: Add the below piece of code in your observer method. NSArray *timeRanges = (NSArray *)[change objectForKey:NSKeyValueChangeNewKey]; CMTimeRange timerange = [timeRanges

AVPlayer not rendering to its AVPlayerLayer

放肆的年华 提交于 2021-02-04 19:54:05
问题 I have a AVPlayerLayer (subclass of CALayer) and I need to get in into a image type that can be passed to a QCRenderer (QCRenderer accepts NSImages and CIImages.) I can convert the CALayer to a CGImageRef, and that to an NSImage, but the contents is always clear. I've narrowed it down to one of two reasons: I am not creating the NSImage correctly. The AVPlayer is not rendering to the AVPlayerLayer. I am not receiving any errors, and have found some documentation on converting CALayers. Also,

how to run “3gp, FLV, avi” video format in AVPLAYER or MPMoviePlayerViewController in iOS?

僤鯓⒐⒋嵵緔 提交于 2021-01-28 23:51:01
问题 I need to play 3gp, FLV, avi Video file format in my application. I had searched lot about it. Got some library like "FFmpeg" Library. But could not find any sample code for it. Any other ways for it are also appreciated. Does any body have done it before? I am even not sure that if it is possible or not in iOS. Please give me solution for it. UPDATE : I tried one 3gp Video in my AVquePlaye but it is not play in my code, While i use same Video in WhatsApp in my iPhone , Surprisingly video is

AVPlayer status AVPlayerStatusFailed not working Properly

痴心易碎 提交于 2021-01-28 17:35:25
问题 I am implementing AVPlayer (not AVAudioPlayer) and trying to play audio from URL. It is working fine. But as we know that sometimes we can have invalid URL (URL that does not have Audio byte). When I play audio from any URL AVPlayer status shows always AVPlayerStatusReadyToPlay which is wrong. For example : In URL part if give invalid URL like : http://soundx.mp3slash.net/indian/jhankar_beats/1%28mp3pk.com%29.mp3 (it does not works even in your browser) and even if you give https:/

Change AVPlayer Orientation- Swift

不羁岁月 提交于 2021-01-28 07:29:54
问题 I have looked at multiple ways to change the orientation (rotate 90degrees) of an AVPlayer/AVPlayerLayer. The most common way I found was to do this: playerLayer.setAffineTransform(CGAffineTransform(rotationAngle: CGFloat.pi / 2)) This what it looks like when I do that (on aspectfill): As you can see, this doesn't work for me and I think it's because of the changes in xcode and swift over the years. How would you rotate the AVPlayerlayer 90degrees now? Thanks in advance! Code used for

Cannot play videos with AVPlayer when NSAllowsArbitraryLoadsInWebContent is true

末鹿安然 提交于 2021-01-28 04:51:25
问题 I have a very small application with AVPlayer . I am using the following code to play a video: if let urlToPlay = URL(string: "http://some_video.m3u8") { self.player = AVPlayer.init(url: urlToPlay) self.player!.play() } I also added some lines into the file "Info.plist" to be able to play videos with HTTP schemas: <key>NSAppTransportSecurity</key> <dict> <key>NSAllowsArbitraryLoads</key> <true/> </dict> And it works fine. But later I found a flag called NSAllowsArbitraryLoadsInWebContent . I

Swift -AVPlayer' KVO in cell's parent vc causing Xcode to freeze

耗尽温柔 提交于 2021-01-28 03:55:42
问题 I have a cell that takes up the entire screen so there is only 1 visible cell at a time. Inside the cell I have an AVPlayer. Inside the cell's parent vc I have a KVO observer that listens to the "timeControlStatus" . When the player stops playing I call a function stopVideo() inside the cell to stop the player and either show a replay button or a play button etc. 3 problems: 1- When the video stops/reaches end if I don't use DispatchQueue inside the KVO the app crashes when the cell's