avplayer

Swift iOS -AVPlayer Video Freezes / Pauses When App Comes Back from Background

怎甘沉沦 提交于 2019-12-18 06:19:10
问题 I have a video playing in a loop on the login page of my app. I followed this Youtube tutorial to get it to work loop video in view controller The problem is when the app goes to the background, if I don't come back right away, when i do come back the video gets frozen. According to the Apple Docs that's supposed to happen. I tried to use the NotificationCenter's Notification.Name.UIApplicationWillResignActive but that didn't work. How do I get the video to keep playing once the app returns

HTTP Live Streaming with AVPlayer in iOS 4.0?

不想你离开。 提交于 2019-12-18 02:58:09
问题 Is it possible to use HTTP Live Streaming with AVPlayer on iOS 4.0? This was clearly a documented feature of 4.0. However, if I run Apple's SitchedStreamPlayer sample code on my 3GS running iOS 4.0.1, clicking "Load Movie" does not play the stream, but gives an error: 2011-06-21 13:14:49.428 StitchedStreamPlayer[680:307] The asset's tracks were not loaded due to an error: Cannot Open MPMediaPlayer is able to play the same stream on the same device. However, I need a working solution with

iOS: AVPlayer - getting a snapshot of the current frame of a video

て烟熏妆下的殇ゞ 提交于 2019-12-18 02:48:10
问题 I have spent the whole day and went through a lot of SO answers, Apple references, documentations, etc, but no success. I want a simple thing: I am playing a video using AVPlayer and I want to pause it and get the current frame as UIImage . That's it. My video is a m3u8 file located on the internet, it is played normally in the AVPlayerLayer without any problems. What have I tried: AVAssetImageGenerator . It is not working, the method copyCGImageAtTime:actualTime: error: returns null image

Possible to play video using a subclass of NSURLProtocol, using either MPMovieController or AVFoundation?

孤者浪人 提交于 2019-12-18 01:20:31
问题 I'm currently trying to play a video to a URL that has the custom scheme defined in a custom NSURLProtocol subclass. Initially I was using MPMoviePlayerController in an attempt to accomplish this, but after running into problems and checking stack overflow, I found that the MPMoviePlayerController does not handle NSURLProtocol subclasses as expected. How to play movie with a URL using a custom NSURLProtocol? As a result I decided to look at the AVFoundation framework, however, it seems that

AVPlayer “freezes” the app at the start of buffering an audio stream

依然范特西╮ 提交于 2019-12-17 22:04:06
问题 I am using a subclass of AVQueuePlayer and when I add new AVPlayerItem with a streaming URL the app freezes for about a second or two. By freezing I mean that it doesn't respond to touches on the UI. Also, if I have a song playing already and then add another one to the queue, AVQueuePlayer automatically starts preloading the song while it is still streaming the first one. This makes the app not respond to touches on the UI for two seconds just like when adding the first song but the song is

iOS AVPlayer cant play 240 fps video

旧巷老猫 提交于 2019-12-17 20:41:51
问题 I recorded a 240 fps video after changing the AVCaptureDeviceFormat. If I save that video in the photo library, the slowmo effect is there. But, If I play that file from documents directory, using an AVPlayer, I cant see the slowmo effect. Code to play the video: AVPlayerItem *playerItem = [AVPlayerItem playerItemWithAsset:[AVAsset assetWithURL:[NSURL fileURLWithPath:fullPath]]]; AVPlayer *feedVideoPlayer = [AVPlayer playerWithPlayerItem:playerItem]; AVPlayerViewController *playerController =

Saving buffer data of AVPlayer

对着背影说爱祢 提交于 2019-12-17 17:48:11
问题 I am playing audio from my server using AVPlayer in my application. Now I want that when it completely buffer the audio then I can save that data in the application to play it later. So how can I access buffer data and save it for later use? 回答1: You could supply a resourceLoader delegate to take over control of the resource loading process from AVPlayer and then supply it the data as and when it requests and becomes available. The resource loader is a property on AVURLAsset. I've documented

AVPlayer stalling on large video files using resource loader delegate

青春壹個敷衍的年華 提交于 2019-12-17 17:46:07
问题 I am using this approach to save the buffer data of the AVPlayer for video files. Found as the answer in this question Saving buffer data of AVPlayer. iPhone and iPad - iOS 8.1.3 I made the necessary changes to play video and it is working very nicely except when I try to play a very long video (11-12 minutes long and about 85mb in size) the video will stall roughly 4 minutes after the connection finishes loading. I get an event for playbackBufferEmpty and a player item stalled notification.

AVPlayer stops playing and doesn't resume again

狂风中的少年 提交于 2019-12-17 17:25:49
问题 In my application I have to play audio files stored on a web server. I'm using AVPlayer for it. I have all the play/pause controls and all delegates and observers there which work perfectly fine. On playing small audio files everything works great. When a long audio file is played it also starts playing fine but after some seconds the AVPlayer pauses the playing (most probably to buffer it). The issue is it doesn't resume on its own again. It keeps in a pause state and if I manually press the

What player can be used to play transparent video in xcode for playing it in ipad?

时光怂恿深爱的人放手 提交于 2019-12-17 17:17:55
问题 I have a video, which is transparent in some portion. When I try to play this video using AVPlayer or MPMoviePlayer, It is not getting played. Can anyone suggest what player can be used to play a video which has transparent background. Thanks Suresh S 回答1: Use AVAnimator - http://www.modejong.com/AVAnimator/ It requires you to transcode it to APNG or their proprietary format, but it works well. 回答2: You have run into a limitation with the video support provided by Apple under iOS.