Questions tagged [avplayer]

0

votes
0

answer
15

Views

How to run a video from google drive in the application without downloading it?

I use in my app integration with Google drive. I use the GoogleAPIClientForREST library. I get access to the file in my app and I can get any of its parameters that are available. My task is to start playing the video. I searched everywhere, and did not find a solution at the moment. I prefer to run...
Alex Kirov
0

votes
0

answer
6

Views

Setting User Agent for AVPlayer in DELPHI

Hello everyone, I am trying to set an User Agent for AvPlayer in delphi based on the short code below NSMutableDictionary * headers = [NSMutableDictionary dictionary]; [headers setObject:@'YourHeader'forKey:@'User-Agent']; self.urlAsset = [AVURLAsset URLAssetWithURL:self.videoURL options:@{@'AVURLAs...
Ziku
0

votes
0

answer
5

Views

AVPlayer Lock Screen updates stop working, only when another AVPlayer instance is played in a subsequent view controller

I have an appliction with View Controllers A and B. View controller A is the presenter of view controller B (pushes it using a navigation controller). Both A and B have a seperate AVPlayer inside them (A's plays audio. B's plays video. Both local files from docs directory). VC A configure...
FranticRock
1

votes
2

answer
623

Views

AvPlayer is unable to play sound in device

My code perfectly works fine in the simulator and it streams the url without any issue. But when plugged to the actual device it doesnt play the audio. My code as bellow var playerItem: AVPlayerItem? var player: AVPlayer? func initPlayer() { let url:URL = URL(string:'https://storage.googleapis.com/...
danu
1

votes
1

answer
716

Views

using AVPlayer to play a time lapse within a UIView

I am using a custom image/video picker to pick a time lapse, once the picker view has been dismissed I want to play the time lapse within a UIView that I have put on to the view controller in interface builder. This code I have currently is below but the problem is that at the moment when a time lap...
Tom Fox
1

votes
1

answer
366

Views

What is the major role of Streaming Media Server?

I am new to Live streaming of a data. I have been exploring in a web about how to live stream a Video. Actually I am an iOS developer and I want to develop an App that streams video. I am clear about the fundamentals of live video streaming. I came to know that I will be need a Streaming Media Serve...
1

votes
1

answer
1.3k

Views

Processing subtitles while video is playing in iOS

I need to do some text processing on the subtitle of a local (or remote) video file as they appear on the screen. Currently I am using AVPlayerItem and by looking into its assets I can see that there is a closed-caption track, but I cannot get the actual subtitle text. So the question is how can I g...
Ehsan
1

votes
1

answer
193

Views

AVPlayer add movie to view

Assuming the code below, how would I display the mov within the movieView please? Do I need to subclass AVPlayer in this way or is there a more straightforward way of achieving this? UIView *movieView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 480, 1080)]; movieView.backgroundColor = [UIColor...
Simon
1

votes
1

answer
659

Views

AVPlayerViewController not loading remote URL

I'm trying to play a remote MP4 video in an AVPlayerViewController: self.vcVideo = [[AVPlayerViewController alloc] init]; self.vcVideo.player = [AVPlayer playerWithURL:[NSURL URLWithString:videoURL]]; [self presentViewController:self.vcVideo animated:YES completion:^{ [self.vcVideo.player play]; }];...
scttnlsn
1

votes
1

answer
628

Views

An AVPlayerItem cannot be associated with more than one instance of AVPlayer error playing multiple videos

So I have searched every posting regarding this error and nothing has worked. What happens is that the first time I open the following view controller, everything works. But when I dismiss the controller and try to play the videos a second time, I get this error. Not sure why. NSMutableArray *AVPla...
Shuttor Inc
1

votes
2

answer
1.6k

Views

Accessing multiple audio hardware outputs/channels using AVFoundation and Swift

How do I access additional audio hardware outputs other than 1-2 using AVFoundation? I'm writing swift code for a Mac OS-X app which plays mp3 files through various output devices (USB interface, dante, soundflower) which looks like the following: myPlayer = AVPlayer(URL: myFilePathURL) myPlayer.au...
Michael Sweet
1

votes
1

answer
1.9k

Views

Show video in collection view cell

I want to show multiple videos in a collection view. I have this code: -(NSInteger)collectionView:(UICollectionView *)collectionView numberOfItemsInSection:(NSInteger)section { return array.count; } - (UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(N...
Lothar
1

votes
1

answer
112

Views

Accounting for current time when panning to scrub video

This is the code related to panning/ scrubbable video. The current issue occurs when the second swipe gesture has a delta from the last position of the first swipe. In other words this code needs to take into account the current time of the video to prevent the skip. ``` func didSwipe(panGR: UIPa...
1

votes
1

answer
503

Views

AVPlayer play video multiple times(10-15) getting play icon with cross line

I'm developing ebook reader based app with PDF book consists of multiple PDF pages. Each page have video icon to play video assets. I used AVPlayer to play video using AVPlayerItem and AVURLAsset(stream from URL). Its working fine for 10-15 times of playing the same or different video from the same...
Anbu Mani
1

votes
1

answer
1.3k

Views

Play Videos in TableViewCell

I have videos that I want to display in table view cells. These are the requirements: Each video is only 10 seconds long. Each video will come from the internet (i.e. will not be local). This is important: I want the videos to autoplay and keep looping. So a user does not have to press a play butto...
JEL
1

votes
1

answer
1.1k

Views

Playing a local video using AVPlayer

I just wasted like 3 hours on this and I can't see where I'm going wrong. I'm trying to play a video I have stored locally using AVPlayer. This is how I launch the player: - (void)openVideo:(NSURL *)videoURL { NSLog(@'Playing video with the url:\n%@', videoURL); AVPlayer *player = [AVPlayer playerWi...
Malfunction
1

votes
1

answer
394

Views

Destroy Navigation bar and tab bar on specific view in swift

I have one app to play video that build with swift. I play video on view AVPlayerViewController by story board. and inside the AVPlayViewController are contain with tab bar and navigation bar that I use on previous screen. during play the Video, when I push the done on the top left it will return to...
Leang Socheat
1

votes
1

answer
424

Views

How to rename Done button in AVPlayer?

I'm developing an app in Swift 3.0 that gives users the chance to stream TV channels online. It is restricted to Italy at the time, so I'm trying to translate every button in the app in Italian... but I'm having problems for the Done button (and the 'Live streaming' field) at the top of the AVPlayer...
nickropes
1

votes
1

answer
2.2k

Views

iOS - Use AVPlayerViewController in AVKit obj-c

I am trying to update this deprecated method: 'presentMoviePlayerViewControllerAnimated' however I am not able to import AVKit and use AVPlayerViewContoller. It seems like my Xcode is not seeing this framework somehow. Here is my code: MatchDetailsVC.m -(void) tableView:(UITableView *)tableView didS...
Vuko
1

votes
1

answer
345

Views

Dynamically resizing AVPlayer in iOS 10

I have an AVPlayer that gets loads in a trivial fashion in my iOS 10 app: let player = AVPlayer(url: url) let controller = AVPlayerViewController() controller.player = player present(controller, animated: true) { player.play() } This opens a player which occupies the entire frame of the window. I'd...
randombits
1

votes
1

answer
706

Views

periodicTimeObserver for duration countdown in AVPlayer with Swift

I have a time observer for AVPlayer that works great. Im trying to get it to countdown from the duration of the audio 0. It works and does count down now I'm just having some trouble with formatting. if you see the picture below you'll see what i mean. It goes from whole minutes:seconds 3:00, to w...
Pippo
1

votes
1

answer
845

Views

AVPlayer Content Modes

I have a AVPlayer, and am using it as a background in my UIView as an aesthetic. To initialize and instantiate it, I do override func viewDidAppear(_ animated: Bool) { super.viewDidAppear(animated) guard let path = Bundle.main.path(forResource: 'Background', ofType:'mp4') else { debugPrint('Backgrou...
dovedevic
1

votes
1

answer
2.3k

Views

play video in single cell in collection view

I have problem with playing video in the collection view cell in single cell cell can have both video and images, when its video the video is downloaded and played from local directory collection View has 2 cells in each row problem is : i want video to play in only 1 cell at a time and stop when th...
Khushboo
1

votes
1

answer
802

Views

AVPlayerItem.duration returns as NaN even after player.status == .readyToPlay

I have an implementation using KVO on player.status much like the suggestion documented here. Here's the relevant bits: var player: AVPlayer? var url = URL(string: 'some video url')! override func viewDidLoad() { super.viewDidLoad() initializeVideoPlayer() } func initializeVideoPlayer() { let playe...
Sam L.
1

votes
3

answer
362

Views

AVPlayer with AVPlayerLayer not playing video

I've got a video file named Intro.m4v which has a target membership on my app target (and the video itself is straight from iPhone so I'm pretty sure it's iPhone-supported). I'm trying to play the video as follows (self.videoContainer is a fullscreen view inside my view controller, and double checke...
1

votes
1

answer
822

Views

How to change the rate of an AVPlayer video

Hey I'm trying to get a video to play at a different rate (Slower). I can't seem to get it to work. Code: This line of code doesn't work playerLayerView.player?.rate = 0.50 Full Code: var player = AVPlayer() var playerLayer = AVPlayerLayer() var playerLayerView = AVPlayerViewController() let path...
Hunter
1

votes
1

answer
995

Views

Swift Mac OS - How to play another video/change the URL of the video with AVPlayer upon a button click?

I am new to swift and I am trying to make a Mac OS app that loops a video from the app's resources using AVPlayer as the background of the window once the app has been launched. When the user selects a menu item/clicks a button the background video will instantly change to a different video from the...
Amateur Programmer
1

votes
1

answer
1.2k

Views

How to play local video in AVPlayer using an array of URL's?

I am developing a iOS app and I want to be able to play a local video file when you select a row from a table view. After a cell row is selected, it hen segues to an AVPlayerViewController where the video should be played, however after the segue is performed and the AVPlayerViewController is presen...
Marko Cain
1

votes
2

answer
119

Views

play audio using different swift file

below is the code representing a file for an audio player. I'm trying to utilize it for playing sounds in my program. I don't want to put a AVPlayer function in every view controller to play repeatable sounds, so I'm looking for a way to put everything in one place and call to the specific function...
aleksy.t
1

votes
2

answer
579

Views

Swift Avplayer inside tableview cell still playing when dismissing changing controller

I configure an avPlayer inside my tableview cell: func createPlayer(url: URL) { self.playerCell = AVPlayer(url: url) self.videoContainerView.playerLayer.bounds = self.videoContainerView.bounds self.videoContainerView.playerLayer.videoGravity = .resizeAspectFill self.videoContainerView.playerLayer.pl...
Marco
1

votes
1

answer
910

Views

Swift iOS -CMTimeMakeWithSeconds: warning: error of -0.433 introduced due to very low timescale

I'm using AVPlayer to play a video. I followed this video tutorial Let's Build That App I use a UISlider/scrubber to go along with the current frame/time of the video. I have a video that is 10.43 seconds and I use a fast forward function that takes me to the very end. @objc fileprivate func handle...
Lance Samaria
1

votes
2

answer
92

Views

Swift: Playing audio using AVPlayer - Audio is not playing, cannot hear audio

I am using AVPlayer to play an mp3 audio file only. I am using a url that I tested and works fine. I needed to use the AVPlayer because I needed to setup a UISlider programmatically and AVPlayer is convenient. The UISlider works and updates as the audio plays. The audio might be be playing but I can...
N. Der
0

votes
0

answer
4

Views

How to load mp3 bit by bit instead of all at once for an AVPlayer?

I am trying to load a big mp3 file (more than 1 hour long) so that I can then play it in an AVPlayer. Sometimes, the file takes a really long time to load. I was wondering if there was a way to load the first minute of the file, for instance, so the user can start listening and then load the rest as...
Tob
1

votes
2

answer
928

Views

Stop AVPlayer music in another controller

so I have this variable in my delegate named AppDelegate.h: AVAudioPlayer *introSound; It plays continuously during first load. [introSound stop]; What I want to do is stop it from a separate controller, firstController.m. I tried [AppDelegate.introSound stop]; but it threw an error saying: error: e...
TRF
1

votes
2

answer
2.3k

Views

AVPlayer + loop + background

I need to: play a sound loop continue to play in background All works fine with AVAudioPlayer, but now I have to use AVPlayer to play also music songs from the iPod library. But there is a big problem: AVPlayer has no numberOfLoops property like in AVAudioPlayer. Ok, you can register a notification...
user370773
1

votes
1

answer
1.9k

Views

How much video content is pre buffered when using AV player with HTTP Live Streaming and can that value be changed

I am writing a video app that plays streaming videos from the web and I am using AV player to do so. My question is how do I find out how much video content is pre buffered, in MPMoviePlayerController you can see the amount of buffered content on the UISlider. I would like to show the same using AV...
coderGirl
1

votes
1

answer
923

Views

It's possible to play sound from main bundle with AVPlayer?

It's possible to play sound from main bundle with AVPlayer ? It's working with URL adress from internet or ipod library but from main bundle no :( Why ?
Igor Bidiniuc
1

votes
1

answer
496

Views

AudioQueueLevelMeterState from AVPlayer object

Is it possible to extract queue's from AVPlayer somehow, because from a queue is possible to extract objects like AudioQueueLevelMeterState, or information about channel numbers, sublevel meters to draw some nice animation on the scene while sound is playing, thanks in advance.
Florik
1

votes
1

answer
3.1k

Views

Can't Play Sound on Xcode iphone simulator

I am trying to play a sound thats linked to a button, but I get the following error code. How can I fixed this problem? 2012-01-13 07:22:58.887 M3NYFAC3Z[5875:1e03] Error loading /System/Library/Extensions/AudioIPCDriver.kext/Contents/Resources/AudioIPCPlugIn.bundle/Contents/MacOS/AudioIPCPlugIn: dl...
M3NYFAC3Z.COM
1

votes
1

answer
1.8k

Views

How do I subclass AVPlayer?

I'm working to subclass AVPlayer so that I can create a method that skipsBackwards in a queue of music. I want to build a fully functional music player that uses music from the users iPod. So that means AVAudioPlayer is out as well as MPMusicPlayerController. Also Core Audio scares me so I'm hoping...
Aaronium112

View additional questions