Questions tagged [avplayer]

An AVPlayer object is used to implement controllers and user interfaces for single- or multiple-item playback.

An AVPlayer object is used to implement controllers and user interfaces for single- or multiple-item playback.

3602 questions
56
votes
4 answers

Accessing URL from AVPlayer object?

Is there a way to access the URL from an AVPlayer object that has been initialized with a URL, as in: NSURL *url = [NSURL URLWithString: @"http://www.example.org/audio"]; self.player = [AVPlayer playerWithURL: url];
Claudijo
  • 1,321
  • 1
  • 10
  • 15
55
votes
6 answers

Screenshot for AVPlayer and Video

I am trying to take a screenshot of an AVPlayer inside a bigger view. I want to build a testing framework only, so private APIs or any method is good, because the framework will not be included when releasing to the AppStore. I have tried with…
vodkhang
  • 18,639
  • 11
  • 76
  • 110
47
votes
6 answers

avplayer has no sounds when play video

Here is all my code for play a mp4,the mp4 is playing but no sounds out import UIKit import AVFoundation class ViewController: UIViewController { @IBOutlet weak var containerView: UIView! var playerLayer:AVPlayerLayer! var…
Xingou
  • 1,141
  • 1
  • 10
  • 20
47
votes
3 answers

Multiple videos with AVPlayer

I am developing an iOS app for iPad that needs to play videos in some part of the screen. I have several video files that needs to be played after each other in an order that is not given at compile time. It must looks as if it is just one video…
Peter
  • 1,495
  • 1
  • 14
  • 21
46
votes
3 answers

MPNowPlayingInfoCenter not reacting properly when pausing playback

I am trying to get MPNowPlayingInfoCenter to work properly when pausing playback. (I have a streaming music app that uses AVPlayer for playback, and I am playing back in my Apple TV over Airplay.) Everything but pausing seems to be reflected…
Jaanus
  • 17,688
  • 15
  • 65
  • 110
45
votes
9 answers

AVPlayer stops playing and doesn't resume again

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.…
iAmd
  • 812
  • 1
  • 12
  • 22
44
votes
1 answer

Error=-25300 from AVPlayer

When I use AVPlayerItem(url: customUrl) from my app I get following runtime error: CredStore - performQuery - Error copying matching creds. Error=-25300, query={ class = inet; "m_Limit" = "m_LimitAll"; "r_Attributes" = 1; sync =…
Warpzit
  • 27,966
  • 19
  • 103
  • 155
41
votes
15 answers

How can I check if my AVPlayer is buffering?

I want to detect if my AVPlayer is buffering for the current location, so that I can show a loader or something. But I can't seem to find anything in the documentation for AVPlayer.
vrwim
  • 13,020
  • 13
  • 63
  • 118
41
votes
4 answers

RTCReporting & pancake.apple.com errors

Yesterday I updated Xcode to Version 5.1 (5B130a); the simulator's version now reads Version 7.1 (463.9.41). Today I started getting these weird errors when beginning playback using AVPlayer. I have never seen any such errors in the past, can't find…
mkc842
  • 2,361
  • 2
  • 26
  • 38
40
votes
3 answers

Changing playerItem of AVPlayer in UITableView

I have a UITableView containing a number of videos to play when scrolling. As the cells in the tableView are being re-used, I only instantiate one AVPlayer for each row, ever. When a cell is re-used I simply change the PlayerItem of the cell's…
Sti
  • 8,275
  • 9
  • 62
  • 124
38
votes
3 answers

Impossible to stop AVPlayer

I am currently testing the use of AVPlayer with audio streaming url, using Swift. There are play() and pause() methods, but the problem is that, pausing only, the stream remains cached in the device. Here is my test code : import UIKit import…
w3spi
  • 4,380
  • 9
  • 47
  • 80
37
votes
6 answers

AVPlayer streaming progress

I'm successfully using AVPlayer to stream audio from a server and what I want to do now is to show a custom UISlider who shows the progress of the buffering. Something like this: With AVPlayer there doesn't seem to be a way to get the total…
pablasso
  • 2,479
  • 2
  • 26
  • 32
37
votes
7 answers

AVPlayer, notification for play/pause state?

I'm searching for a way to get notified the exact moment when AVPlayer starts playing. There's the "rate" property, but currently I am checking it periodically with an NSTimer to get updates. I tried KVO, but apparently it's not KVO compliant. I…
steipete
  • 7,581
  • 5
  • 47
  • 81
37
votes
3 answers

Swift: AVPlayer playing video is showing this error: [AVOutputContext] WARNING: AVF context unavailable for sharedAudioPresentationContext

I'm trying to play a video from bundle directory but I'm getting this error: video[29054:2968406] [MediaRemote] [AVOutputContext] WARNING: AVF context unavailable for sharedAudioPresentationContex This is my implementation: import UIKit import…
user2924482
  • 8,380
  • 23
  • 89
  • 173
37
votes
2 answers

An AVPlayerItem cannot be associated with more than one instance of AVPlayer in iOS 8.4

After updating to iOS 8.4 I am getting the infamous exception with MPMoviePlayerController that says: An AVPlayerItem cannot be associated with more than one instance of AVPlayer I have seen several workarounds that mainly consist of reinitialising…
pajevic
  • 4,607
  • 4
  • 39
  • 73