Questions tagged [avplayeritem]

277 questions
7
votes
0 answers

Clearing AVPlayer Cache

1) I am streaming videos on the player from server. Each time playing the video on app increases the app memory. So if I watch the video for 10 times, 10times the size of video is increased in app memory. Am using AVPlayer for this. 2) Stop…
Manoj
  • 1,482
  • 2
  • 20
  • 53
6
votes
0 answers

How to get current ts file from avplayer

I'm trying to figure out how to get current ts file from the avplayer. I tried subclassing NSURLProtocol, but that doesn't show the url from the avplayeritem. Thanks.
ordinaryman09
  • 2,761
  • 4
  • 26
  • 32
6
votes
0 answers

Swift: AVPlayer release memory / resources

I am writing an app that need display different video according to the selection of the user. When the user select a video, the function playVideo will be called. And after the video finish playing, then the videoView will be hidden again. My code…
user6539552
  • 1,331
  • 2
  • 19
  • 39
6
votes
2 answers

AVPlayer is never ready to play

I have an AVPlayer that is loading a remote media URL (HLS stream) and sometimes the player is never ready to play, but no error is presented. Is there somewhere else an error can be or a way to check if it is still loading the AVPlayerItem? I have…
Alex Yurkowski
  • 1,676
  • 1
  • 12
  • 26
6
votes
1 answer

How to extract closedcaptions/subtitle from AVPlayer

Since closed-captions rendered by AVPlayer sometimes overlap with other UI components I would like to render cc in a separate view. I am able to turn off AVPlayer's cc rendering by setting closedCaptionDisplayEnabled to NO but I did not find a way…
Matthew
  • 4,935
  • 5
  • 21
  • 17
6
votes
2 answers

How to find AVPlayer current bitrate

I am trying to fetch bit rate at which the AVPlayer is playing the video stream . I tried with observed bit rate property of AVPlayerItemAccessLogEvent , but it gives very high value.After exploring further on Observed-bit-rate property I understood…
karthik
  • 1,271
  • 1
  • 14
  • 27
6
votes
0 answers

AVPlayer/AVAudioMix fade-in effect clicks in the beginning

I'm trying to implement a fade-in effect based on AVPlayer + AVAudioMix + AVAudioMixInputParameters. It basically works except when playing the audio for the first time after starting my app there is a click in the beginning. Subsequent plays work…
mojuba
  • 11,842
  • 9
  • 51
  • 72
5
votes
1 answer

how to get bitrate of video streaming on iPhone/iPad devices?

I have an iOS app that streams video on iPhone/iPad devices. Now I need to get the bitrate on video streaming on the iPhone/iPad device. ObservedBitrate and IndicatedBitrate does not help with this. I also came across this below post but few…
sia
  • 1,872
  • 1
  • 23
  • 54
5
votes
1 answer

AVPlayer flashing when using replaceCurrentItem() - Swift - Programmatically

I'm setting up an AVPlayer in a UIView in this way: fileprivate func setUpAVPlayer(){ self.cardModel?.urlStrings?.forEach({ (urlString) in guard let url = URL(string: urlString) else { return } let asset =…
StackGU
  • 868
  • 9
  • 22
5
votes
0 answers

white flicker when switch from one video to another iOS 13 and above swift

I am using AVQueuePlayer to play all the selected videos in loop or change the videos on swipe gesture. But when i implemented the flow, there was black frame when user swipe changes the video from one to another.So to overcome that issue i used…
Zღk
  • 854
  • 7
  • 25
5
votes
0 answers

Control AVPlayer Buffer

I want to prevent a mp3 or audio stream from buffering past a certain amount of seconds. Apple's documentation for controlling buffer doesn't seem to be very helpful. I tried using AVPlayerItem's preferredForwardBufferDuration and setting…
fnw1989
  • 121
  • 5
5
votes
0 answers

AVPlayerItem: Segment exceeds specified bandwidth

I'm registering observer to AVPlayerItemNewErrorLogEntry, and sometimes I get this error statusCode: -12318 Segment exceeds specified bandwidth for variant when playing live hls. anybody know what causes this? Thanks.
ordinaryman09
  • 2,761
  • 4
  • 26
  • 32
5
votes
0 answers

AVURLAsset / AVPlayerItem from Asset Catalog

I have a bunch of audio files which I keep in my asset catalog to benefit from the store optimizations that it brings. However, the AVAudioPlayer ideally wants AVURLAssets from which subsequently AVPlayerItems can be created. Problem is, asset data…
hoshy
  • 481
  • 6
  • 15
5
votes
2 answers

Playing videos in UICollectionViewCell. Video is playing fine but have scroll performance on collectionView

I explored other answers on community and tried this - player = AVPlayer() player.volume = 0.0 player.actionAtItemEnd = AVPlayerActionAtItemEnd.None addPlayerLayer() let asset = AVAsset.init(URL: videoURL) …
Ajay Kumar
  • 1,807
  • 18
  • 27
5
votes
1 answer

AVPlayerItem doesn't play video even its status is `readyToPlay` and `isPlaybackLikelyToKeepUp` is true

I'm playing live video with AVPlayer and AVPlayerItem. I'm observing AVPlayerItem's status, isPlaybackLikelyToKeepUp, and AVPlayerItemPlaybackStalled. I'm also observing AVPlayer's rate. While I'm testing I found really weird thing happened. While…
Ryan
  • 4,799
  • 1
  • 29
  • 56
1 2
3
18 19