Questions tagged [avplayer]

1

votes
1

answer
390

Views

Setting HTTP Header Fields for AVURLAssets

I'm attempting to load a video file that requires a token in the header. I learned on Stackverflow that this may be possible from looking at the following question. The problem is that I don't believe AVURLAssetHTTPHeaderFieldsKey is public or I have written my asset variable incorrectly. What I'...
Cosmic Arrows
1

votes
0

answer
110

Views

How to achieve metering with AVPlayer in ios?

AVAudioPlayer provides metering. We can enable it by setting true to the property isMeteringEnabled. And then call updateMeters method to update the values to get a particle effect music visualizer as explained in th link given below: https://www.raywenderlich.com/36475/how-to-make-a-music-visualize...
Rahul Gupta
1

votes
1

answer
150

Views

CMTimeGetSeconds duration and addPeriodicTimeObserver doesn't equal at the end

Does anyone know why my CMTimeGetSeconds value from duration, and addPeriodicTimeObserver are not equal? It works great if total seconds are less than 0.5 hour but not if over it. Thanks! audioPlayer?.addPeriodicTimeObserver(forInterval: interval, queue: DispatchQueue.main, using: { (progressTime) i...
1

votes
0

answer
282

Views

AVPlayer with downloaded content doesn't work but streaming content does

I am trying to (1) download a piece of audio from a link, (2) add that newly-downloaded audio to an AVPlayer and (3) play it. Something is going wrong at step (3) and I'm looking for any guidance. Here's the code, including my alamofire and download functions, as I fear something may be going wrong...
RMoore
1

votes
1

answer
1k

Views

How to direct download large file from Google drive without Google Drive can't scan this file for viruses message

I'm trying to play a music file in my Google drive but it's about 300mb so Google won't let me directly download it using this link. https://drive.google.com/uc?export=download&id=12cpUAP0wy8jyMD4-rjKJ23bicCJ29Cs- There is a 'google drive can't scan this file message' and download anyway button. I t...
1

votes
1

answer
190

Views

Disable “drag” function for AVPlayer

My app plays videos for toddlers. It uses AVPlayer. In a recent update Apple has implemented the function of dragging the video view to close it. This doesn't work well with toddlers touching the screen all the time. Does anyone know how to disable this function? (the code is in Objective-C)
Emily94
1

votes
0

answer
227

Views

crossfading effect with AVPlayer

I want to create crossfading effect with two AVPlayer, one player for current track and other for nextTrack. where player one is my central player(tracking remote control event and progress), on player one did finish playing event second player become central player. Thanx!
SPatel
1

votes
0

answer
661

Views

iOS 11 MPNowPlayingInfoCenter not showing details

I play some audio files with AVPlayer and now I want to display track info in Control Center or on the Lock screen. I set it up like this: NSDictionary *info = @{ MPMediaItemPropertyArtist: @'Test', MPMediaItemPropertyAlbumTitle: @'Test', MPMediaItemPropertyTitle: @'Test', MPNowPlayingInfoProperty...
John Sax
1

votes
0

answer
151

Views

AVPlayerItem.seek(to: cmTime, toleranceBefore:, toleranceAfter:) to get specific video frames?

This week I've had a miserable time trying to get video frames from a Quicktime movie and display them in a Metal texture. It has been far harder than I anticipated. I just want to show frame 0, and then step back and forth through the video frames with the arrow keys. After failing with the AVPla...
bsabiston
1

votes
0

answer
30

Views

Dynamic tvOS navigation markers

I have successfully built a AVNavigationMarkersGroup (consisting of multiple AVTimedMetadataGroups), which I can attach to an AVPlayerItem before loading the video into an AVPlayer. However, there are two things I have not been able to do, and I wonder if this is possible: Dynamically update these m...
RamwiseMatt
1

votes
0

answer
101

Views

How to add an iOS Observer on AVPlayer in nativescript plugin?

I am developing a nativescript app that stream a webRadio, and for that I have used the plugin nativescript-audio. This plugin do the job on Android, but on the iOS part, I have replaced the AVAudioPlayer by AVPlayer because AVAudioPlayer doesn't manage web streaming. Actually, I try to understand...
Ken
1

votes
0

answer
61

Views

How to stop video from playing when switch tabbar view controller

I'm taking an Instagram clone tutorial. I have issues when playing video in table view controller and switching out of that tab bar controller into another view the video is still playing from the previous controller. When researching for possible answers. Most recommend to stop the video player fro...
kevcharmher
1

votes
0

answer
269

Views

Sync AVPlayer video with an audio file played with AVAudioPlayerNode

I have an AVPlayer instance that plays a locally stored file containing both video and audio tracks. While playing (or just before playing the file) I would like to add some audio effects using AVAudioEngine. By looking around I did not find a correlation between AVAudioEngine and AVPlayer so my que...
giorashc
1

votes
0

answer
381

Views

Audio Controls on Lock Screen/Control Center From AV player Issues

Im new to swift and Im having issues while using MPRemoteCommandCenter. When I try to control the audio settings, previously accessed songs also start playing along with the current song. Im trying to access using the following code: UIApplication.shared.beginReceivingRemoteControlEvents() let comma...
Geethanjali Reddy
1

votes
0

answer
282

Views

How to play Vimeo Video Url in iOS app

I am not able to play vimeo video url using AVPlayer in swift 4 and below code for I am using : let player = AVPlayer(url: URL(string: self.trailerVideoURL)!) let playerController = AVPlayerViewController() playerController.player = player present(playerController, animated: true) { player.play() }
iHarshad
1

votes
0

answer
249

Views

AVPlayer replaceCurrentItem not reset status

I have a list of AVPlayerItem to play. I use a single AVPlayer and call AVPlayer.replaceCurrentItem to switch between them. It works fine, but if one of the AVPlayerItem has unreachable URL, and I play it, the AVPlayer just broken, not usable anymore. Even if I call replaceCurrentItem to another ite...
Jeffrey Chen
1

votes
1

answer
515

Views

Invalid asset name supplied: '(null)'

I am trying to make an iPhone application where you press a button and it streams a video from my mac to the phone via MAMP. When I hit the button the player shows up however the video does not play and I get this error. 2018-03-15 10:19:30.487597-0500 stream[5956:2522500] CredStore - performQuery -...
pillarman38
1

votes
0

answer
128

Views

AVPlayer Stuck in play : We have added AVPlayer in horizontal collection view but its stuck some time while play in multiple time

self.avPlayerItem = [AVPlayerItem playerItemWithURL:[NSURL URLWithString:mediaURL]]; above line giving error : CredStore - performQuery - Error copying matching creds. Error=-25300, query={ class = inet; 'm_Limit' = 'm_LimitAll'; 'r_Attributes' = 1; sync = syna; } and some time stuck and some time...
UserDev
1

votes
0

answer
185

Views

KVO Crashes while using AVPlayer

I use AVPlayer to play remote videos in Swift, but keep getting these crashes showing up #0 Crashed: com.apple.avfoundation.playerlayer.configuration EXC_BREAKPOINT 0x000000010522f968 0 libswiftCore.dylib __hidden#23281_ line 134 specialized _assertionFailure(StaticString, String, file : StaticS...
gene
1

votes
0

answer
57

Views

Got playerasync_runAsynchronousCommandOnQueue while playing the playerItem on the AVPlayer

I have the following trying to play a playerItem on the AVPlayer let avAsset = AVAsset(url: url) let playerItem = AVPlayerItem(asset: avAsset) let avPlayer = AVPlayer() let playerLayer = AVPlayerLayer(player: avPlayer) playerLayer.videoGravity = AVLayerVideoGravity.resizeAspectFill avPlayer.replaceC...
Kesong Xie
1

votes
1

answer
289

Views

m3u8 playlists using HLS adaptive bitrates and media options

I have a media player app on iOS which uses HTTP Live Streaming to stream video. We use a master playlist file which references three different streams via another m3u8 file, and use the media options to select which stream to play. This works fine currently, but we now want to use adaptive bitrate...
Ian Newson
1

votes
1

answer
165

Views

Adding an external audio track to HLS video

I am using AVPlayer to run a HLS video. The video has no sound. Also i have a audio track url of same format m3u8. Can i somehow change the AVPlayer item asset or something while running my video without sound to add my other audio track so that they are sort of played together.
Nikhil Gupta
1

votes
0

answer
141

Views

AVplayer not playing live audio stream

I have a custom UI for the AVplayer with all the bells and whistles like a scrubber to seek a button to play/pause the audio in a separate view controller. I have them on a two tab bar controllers, one of streaming audio and the next for live streams, when a playable stream is selected, the view con...
Abhinav Jayanthy
1

votes
0

answer
104

Views

Displaying AVPlayer in QML

I'm working on a DRM feature for playing video in my QML application on IOS devices. I managed to play the 'video' (sound only) using IOS native player (AVPlayer), and currently struggling on getting the video inside the application. Prior to that I worked only with pure QML code. Since I'm not that...
light01
1

votes
0

answer
18

Views

pixel data is NULL only after seeking to frame 0

I'm trying to buffer video frames one at a time using this: CGFloat frameTimeSeconds = 1/self.fps * frame; CMTime frameTime = CMTimeMakeWithSeconds(frameTimeSeconds, self.player.currentItem.asset.duration.timescale); CVPixelBufferRef nonSeekPixelBuffer = [self.videoOutput copyPixelBufferForItemTime:...
mcornell
1

votes
0

answer
61

Views

AVPlayer don't update current time when i change player.rate from 4 to 1

Im using AVPlayer to play m3u8 stream. Current time is normally updated when i increases rate, but if I set it from 4 to 1 or 2, the current time stops updating. If I set this number again to 3 or 4, it will suddenly update to the actual values. Swift 3.2, iOS 10.2.
Utashev Ruslan
1

votes
2

answer
174

Views

swift: chat app - audio player within cells

My app allows users to send audio just like in a typical messaging app. The problem is that every time a new message comes in and therefor I'm refreshing my collectionView, the audio stops. Right at the moment I have a AVPlayer within the message cell itself. Is there any better way and how can I en...
ktm125
1

votes
0

answer
102

Views

AVQueuePlayer not playing sound after first use

I use a AVQueuePlayer to play a few sounds in a row. This works fine, even in the background. The problem occurs after the player ends, or after I try to cancel the player with something like audioPlayer.pause() or audioPlayer removeAllItems(). In both cases I cant use the player again, it just won...
user9718615
1

votes
0

answer
120

Views

UICollectionView loading issue with AVPlayer in CollectionViewCell

When I use AVPlayer inside UICollectionView, faced so many performance issues like: App crashing due to high memory usage.To resolve this I called override func prepareForReuse() { super.prepareForReuse() self.player = nil self.playerLayer.removeFromSuperlayer() } When I do this and, at the time of...
Rukku Guptha
1

votes
0

answer
46

Views

iOS Streaming : timedmetadata not returning the entire value

Trying to play an live audio stream in which I am observing the 'timedMetadata' The normal data items are getting retrieved such as the content title and url..But there is some extra data coming as part of the ICEcast which is basically for playback of Ads.This data however is visible in Charles is...
Lithu T.V
1

votes
0

answer
215

Views

Remote controls of audio player are not visible in IOS 11 lock screen

I have a custom class which plays an audio with AVPlayer. In the method of this class have added play, pause, previous and next track commands to MPRemoteCommandCenter instance like so: let mediaPlayerCommandCenter = MPRemoteCommandCenter.shared() mediaPlayerCommandCenter.playCommand.addTarget(self,...
Orxan Kerimli
1

votes
0

answer
25

Views

How to download multiple videos at a time?

I want to download multiple videos at a time but in my case upto 3 videos downloaded properly but after that its override previous one. I am using urlSession downloadTask for running in background and save into document directory. Is there any better way to do this?
iHarshad
1

votes
2

answer
38

Views

The URL given through the AVCaptureFileOutputRecordingDelegate function unable to be played

I'm trying to create a Snapchat-like app where the user can take a video by holding down a button. However, when the user is done taking a video, and the delegate calls fileOutput, the given url outputFileURL cannot be played using an AVPlayer. I know that the video was actually recorded though, bec...
kbunarjo
1

votes
1

answer
316

Views

iOS FairPlay videos not playing after obtaining CKC from server

I am trying to implement FairPlay in my application. I am able to play an encrypted video using the SDK given by Apple but the problem is the SDK is in Swift but my project is in Objective C. So i have re-written the code in my project but i am unable to play a video. Here are the links in am using:...
Vitul Goyal
1

votes
1

answer
77

Views

Play remote wav audio

I'm trying to play wav audio files from a remote URL, I was using this StreamPlayer library to play the remote audio file. However, It is not working for the wav formats, although it is working for mp3's. I tried the using the native AVPlayer in iOS, but it is waiting until the buffering finishes,...
Ahd Radwan
1

votes
0

answer
34

Views

scrollview stops zooming after dragging once

I have a project where I'm using AVPlayer to reproduce a video which is contained in a UIView inside a scrollview. I need to be able to zoom in and out and drag/scroll, but the zooming stops working right after I drag the video once. I am zooming using the same approach I would use when zooming an I...
K. Zet
1

votes
0

answer
165

Views

Load local encrypted video file Asset into AVPlayer

I want to try read the Data from a encrypted 'video' file, decrypt the data and make it run on AVPlayer. My app can download a video, the video comes encrypted from my API. All I have to do is: decrypt the file with a cypher and then it becomes a valid mp4 file. Theses steps are covered. I did the...
Rafael Natali
1

votes
0

answer
36

Views

Play HLS video clips from URL in AVplayer when multiple startTime's and EndTime's are received in JSON for multiple clips for the same video

I calculated the duration to stop the clip at the received end time. Start time works fine but it never stops at end time . - (CMTime)playerItemDuration { AVPlayerItem *playerItem = self.currentVideoVC.player.currentItem; if (playerItem.status == AVPlayerItemStatusReadyToPlay) { CGFloat duration =...
i.sai
1

votes
0

answer
85

Views

AVPlayer not play

I have UICollectionView and UICollectionViewCell I created AVPlayer in IUCollectionViewCell When I click on the cell print AVPlayer Play but AVPlayer not play. UICollectionView Cell ; class UserProfilePhotoCell: UICollectionViewCell { var avPlayer: AVPlayer? var avPlayerViewConroller: AVPlayerViewCo...
Sener
1

votes
1

answer
54

Views

About the AVPlayerLayer crash for KVO key path operationCount

recent I used AVPlayer to play while downloading, everything seems fine. Bug I found some crash about AVPlayerLayer. the error info like this: An instance 0x170038f60 of class AVPlayerLayer was deallocated while key value observers were still registered with it. Current observation info: NSKeyValue...
lee xin

View additional questions