avplayer

How handle streaming error with AVPlayer

亡梦爱人 提交于 2019-12-07 10:45:17
问题 I use AVPlayer to stream tracks.I'm trying to handle all errors like network unavailable or stream unaivalable But I find any handler for this kind of error. I've already added a KVO for on the avplayer's status. [self.player addObserver:self forKeyPath:@"status" options:0 context:nil]; But even the stream doesn't exist (example: wrong url), the status switch to AVPlayerStatusReadyToPlay. EDIT Solution was to work with AVPLayerItems and use AVQueuPlayer. The other problem was I reallocated

AVPlayer streaming stops in background due to gaps [closed]

末鹿安然 提交于 2019-12-07 09:01:57
问题 It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center. Closed 6 years ago . I'm attempting to achieve gapless playback due to iOS idling my AVPlayer when the app is in background mode. Before answering, yes, I have the plist modified, audio session properly setup and everything is fine

AVPlayer seekToTime not working properly

邮差的信 提交于 2019-12-07 08:07:47
问题 Im having a problem with seeking with AVPlayer.seekToTime, I have the time index that I want to seek to inside a scrollViewDidScroll method like this: func scrollViewDidScroll(scrollView: UIScrollView) { let offsetTime = scrollView.contentOffset.y * 0.1 self.playerController.player?.seekToTime(CMTime(seconds: Double(offsetTime), preferredTimescale: 10), toleranceBefore: kCMTimePositiveInfinity, toleranceAfter: kCMTimeZero) } But the video does not flow nice. For example, when you scroll I

Playing back video in an SKVideoNode causes a black flash before playback begins

一笑奈何 提交于 2019-12-07 05:48:00
问题 I'm using Sprite Kit and an SKVideoNode to play back a short video. When the video node is added to the scene, be that before of after the initial set up, the player flashes black for a brief second. I have tried using an AVPlayer for the video instead of the video directly, also I've used KVO to only load the SKVideoNode when the video says it's ready to play. Either way I get a black flash before my video starts to play. Also there doesn't seem to be a way to add an AVPlayerLayer to the

AVPlayer slow loading

断了今生、忘了曾经 提交于 2019-12-07 03:10:35
问题 I'm using AVPlayer to play mp3 files from a remote url. i'm having some issues with the initial loading time of the mp3, it is very slow (around 5-8 sec). i compared it with other third parties players and its much slower, i also compared it with an android player and it is also much slower. so the problem is not with the url itself nor with the network connection.. another interesting point is that after the AVPlayer start playing the mp3, seeking is very fast (almost immediately), does that

AVPlayer - switching stream quality while playing

こ雲淡風輕ζ 提交于 2019-12-07 03:09:59
问题 I'm using AVPlayer to play youtube videos, for each youtube video id I retrieve a couple of stream urls in different qualities. I want to play a particular stream quality according to the network state. For example if user is on 3G I want to play the lowest quality URL but if user moves to wifi I want to seamlessly switch to the better quality stream. This is nothing new, youtube is doing that in their app and many others. So I wonder what is the best way to do this kind of switching with

AVPlayer's video and audio become out of sync after pausing and then resuming video

南笙酒味 提交于 2019-12-07 02:16:52
问题 I'm using AVPlayer to play videos in my app. Video playback always works perfectly, except for when you pause/resume the video. If the user presses the pause button, and then resumes the video, sometimes the audio will be ahead of the video. The video resumes at the correct location, but the audio is ahead. It's as if when you press pause, the audio keeps running. When they press the pause button, all I am doing is calling the pause method of the AVPlayer , and I have also tried setting it's

AVPlayer is not playing in iOS 11

三世轮回 提交于 2019-12-06 23:55:45
问题 I am facing an issue with AVPlayer in iOS 11. The same code is working perfectly on iOS 10. I used DRM for playing the video. I am getting below warning : 2017-11-22 20:48:09.237095+0530 AppName[9113:3782887] [] <<<< AVOutputDeviceDiscoverySession (FigRouteDiscoverer) >>>> - [AVFigRouteDiscovererOutputDeviceDiscoverySessionImpl outputDeviceDiscoverySessionDidChangeDiscoveryMode:]: Setting device discovery mode to DiscoveryMode_None (client: AppName) 2017-11-22 20:48:09.266561+0530 AppName

Memory leak in iOS, AVPlayer is never deallocated

僤鯓⒐⒋嵵緔 提交于 2019-12-06 20:49:16
问题 I used the AVPlayerDemo sample from the Apple docs and wrote my own UI on top of it to play videos selected from a UITableViewController. Now, the problem is that there's a memory leak here somewhere which I can't find out. The problem is that the AVPlayer object is not being dealloced, I guessed this because every time a press back button and select a new video to play, there is a huge jump in the total memory consumed by the app which is show here: The first time the video is player, the

Security Scoped Bookmark - bookmark resolves but still can't access the file

给你一囗甜甜゛ 提交于 2019-12-06 17:34:25
EDIT: Additional information added at the bottom I have a sandboxed, document based application that loads a user selected quicktime movie into an AVPlayer, and everything was working perfectly. Now I am upgrading the code so that it will use Security Scoped bookmarks to get the URL rather than just storing a URL string so that the persistent store will allow the movie to be loaded upon relaunch of the application. When the bookmark is created it is stored in a Data variable of a managed object. For some reason, this has broken the AVPlayer. While I have created a bookmark from the user