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
18
votes
8 answers

Is it possible to play video using Avplayer in Background?

I am using Avplayer to show video clips and when i go back (app in background) video stop. How can i keep playing the video? I have search about background task & background thread ,IOS only support music in background (Not video) …
Vishal Khatri
  • 954
  • 2
  • 12
  • 32
17
votes
5 answers

Play multiple Audio Files with AVPlayer

I'm trying to play multiple sounds at the same time. The approach initially I've taken was to create several players , but it seems wrong one. What's the best way to play several audio files at the same time. Is it through making them AVAssets, but…
Rouslan Karimov
  • 585
  • 2
  • 7
  • 19
17
votes
0 answers

AVPlayer currentTime wrong when rewind

I have AVPlayer when I rewind an audio file, then the current time is longer than the total file duration. Who knows what the problem is, why is the current time wrong? @objc func updateProgressBar(){ guard let value =…
Vasya2014
  • 203
  • 1
  • 5
  • 25
17
votes
2 answers

Add custom controls to AVPlayer in swift

I am trying to create a table view such that I am able to play videos . I am able to do this using AVPlayer and layer. I want to add a custom play and pause button with a slider to the bottom of a video view. AVPlayerController comes built in with…
A.S
  • 798
  • 1
  • 10
  • 32
17
votes
3 answers

Get UIImage from the CALayer attached to AVPlayer (extract frame from video playing)

I play a video with AVPlayer. It works ok. Now I want to get a UIImage from the video playing (when I push a button for the moment). Attached to my AVPlayer there is a CALayer that is used to display video on my UIView. My idea is to get an UIImage…
Twil
  • 171
  • 1
  • 4
17
votes
3 answers

m3u8 file AVAssetImageGenerator error

I am using AVPlayer to play .m3u8 file. Using AVAssetImageGenerator to extract image out of it using following code : AVURLAsset *asset1 = [[AVURLAsset alloc] initWithURL:mp.contentURL options:nil]; AVAssetImageGenerator *generate1 =…
objectivecdeveloper
  • 1,050
  • 11
  • 29
17
votes
3 answers

How to connect the audio to bluetooth when playing using AVPlayer

I am playing the audio from an url using AVPlayer, but when the iPhone is connected to a Bluetooth device it is not playing via Bluetooth, how to play via Bluetooth if it is connected, i see some posts in SO, but none of those are clearly explained.…
Sudheer Kumar Palchuri
  • 2,919
  • 1
  • 28
  • 38
17
votes
3 answers

AVFoundation (AVPlayer) supported formats? No .vob or .mpg containers?

Using AVPlayer in a Mac app here to play random videos in fullscreen from a folder, but when I try to play .vob files or .mpg files I just get a black screen that lasts as long as the video lasts. Does AVFoundation not support playback from these…
Christian A. Strømmen
  • 3,181
  • 2
  • 25
  • 46
17
votes
6 answers

Detect when AVAudioSession is being "Ducked"

I'm working on a Podcast app. This plays audio using the AVAudioSessionCategoryPlayback session type. This does almost everything that I want it to do. It pauses other playing music, it gets interrupted when a call comes in and generally works…
David Smith
  • 426
  • 3
  • 7
16
votes
3 answers

Audio Metering levels with AVPlayer

Is there a way to have the audio metering levels from the AVPlayer class? I know that AVAudioPlayer does that, but it doesn't play streamed http .m3u8 urls , like AVPlayer does.
neowinston
  • 7,584
  • 10
  • 52
  • 83
16
votes
1 answer

Inserting an HTTP stream into a AVMutableComposition

I am trying to insert an AVURLAsset of a AVPlayerItem that states AVPlayerItemStatusReadyToPlay into an AVMutableComposition like this: composition_ = [[AVMutableComposition alloc] init]; insertionPoint_ = kCMTimeZero; item_ = [[AVPlayerItem…
Till
  • 27,559
  • 13
  • 88
  • 122
16
votes
4 answers

ios avplayer trigger streaming is out of buffer

I want to reconnect to the server when the streaming buffer is empty. How can I trigger a method when the AVPlayer or AVPlayerItem buffer is empty? I know there are playbackLikelyToKeepUp, playbackBufferEmpty and playbackBufferFull methods to check…
Adam Tang
  • 163
  • 1
  • 1
  • 5
16
votes
0 answers

UI testing with AVPlayer

I'm looking for a way to test my application that use an AVPlayer. How can I load a video file? I tried to record the manipulation but recording stop when calling NSOpenPanel.runModal(). Any idea?
Martin Delille
  • 11,360
  • 15
  • 65
  • 132
16
votes
1 answer

AVPlayer stalling on large video files using resource loader delegate

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…
Paul Cottrell
  • 260
  • 2
  • 9
16
votes
3 answers

iOS 8 - change orientation back to portrait when dismissing full screen AVPlayerViewController

my app is a portrait only app, but I have one view controller which is displaying a live stream, using an AVPlayerViewController. To allow landscape for the full screen view of that player I wrote this method in the AppDelegate.swift: func…
flo_23
  • 1,914
  • 2
  • 14
  • 13