avplayer

iOS AVPlayer control using Bluetooth

孤者浪人 提交于 2019-12-11 15:59:25
问题 I am developing music player application with AVPlayer . Now I have requirement, I want to control my Player with Bluetooth device for operations like Play, Pause, Next and back. Please guide me, what are possible solutions. 回答1: To control remote events the viewController that plays/controls the audio has to be the first responder so add this in viewDidAppear - (void)viewDidAppear:(BOOL)animated { [super viewDidAppear:animated]; //Make sure the system follows our playback status [

addPeriodicTimeObserver is not called every millisecond?

半城伤御伤魂 提交于 2019-12-11 15:49:05
问题 I know that player.currentItem.currentTime().seconds returns the current time in seconds of the audio file that is being played. Can I add a callback function on player to be called every millisecond? For example for second 1, this callBack function should be called 1000 times. The problem is that using addPeriodicTimeObserver the callBack function is called only 1 time per second, rather than 1000 times per second. Why do I need this? 1. I am extracting the beat count of a Salsa song

iOS: Playing offline HLS with AES-128 encryption

我是研究僧i 提交于 2019-12-11 15:10:51
问题 With out FairPlay i am planning to download Streaming URL Content and key. For this i have used Apple sample code HLSCatalog and in that i have integrated below mechanism to get the decrypt key. https://developer.apple.com/documentation/avfoundation/media_assets_playback_and_editing/using_avfoundation_to_play_and_persist_http_live_streams Playing Offline HLS with AES-128 encryption iOS Here i am successfully able to download the key. Once key download is complete then it is calling the below

AVPlayer not playing streaming radio with dynamic URL

烈酒焚心 提交于 2019-12-11 14:36:29
问题 AVPlayer on iOS is perfectly playing radio when doing this AVPlayer *player; player =[[AVPlayer alloc] initWithURL:[NSURL URLWithString:@"http://kantipur-stream.softnep.com:7248"]]; [player play] But it doesn't play any radio when I use NSString variable called link to hold url string of different radios like AVPlayer *player; player =[[AVPlayer alloc] initWithURL:[NSURL URLWithString:link]]; [player play] link is fetched and parsed from an XML document. I can't understand whats the problem.

How to Play a video in AVPlayer for a specific duration in Swift3 iOS

走远了吗. 提交于 2019-12-11 14:18:38
问题 I am creating a Video application in Swift3 . Where we have a list of Video files in a TableView list. For each Video we have given Range Slider option for user to select Range of the Video . Now I am trying to play the Video for that specific range, selected by the User. I am using below code to start a Video from 4 Seconds to 8 Seconds using CMTimeMake but not playing correctly. let targetTime:CMTime = CMTimeMake(4, 1)////Video start self.player?.seek(to: targetTime) self.player?

AVMutableComposition - Only Playing First Track (Swift)

情到浓时终转凉″ 提交于 2019-12-11 13:43:05
问题 I have an array of [AVAsset], and I am trying to combine all of those Assets into a single Asset so that I can play back the video seamlessly (I tried using an AVQueuePlayer, but that does not play back the assets seamlessly). Below is what I have so far, but when I try to play the final composition, it only plays the first track, even though it shows that it has all tracks and the total duration equals all of the tracks together. Am I missing a step, even though it appears that all the

Using remote io for recording and AVPlayer for playing ipod library audio at the same time continuously

谁说胖子不能爱 提交于 2019-12-11 13:32:50
问题 Can I use remote io for recording and AVPlayer for playing iPod library audio at the same time continuously? I tried but the error returned was: AURemoteIO::ChangeHardwareFormats: error -10875. 回答1: As far as I know, officially it is not possible. When you start the recording sessions, except for recording does not occupy it. Once you playback and recording sessions in the session must be solved. recording and playback session, the session can not be occupied simultaneously. refer a apple

AVPlayerViewController with custom overlay

江枫思渺然 提交于 2019-12-11 13:22:39
问题 Migrating to AVkit from MPMoviePlayer has brought me to a blocking issue. I need to display a custom tableView over the AVPlayerViewController. I can this tableview trough [self.avVideoPlayer.contentOverlayView addsubiew:self.mycustomTableView] and it is visible but it doesn't receive any tap/swipe events. Any ideas why this happens or how can I add the table view in a place where it would receive the touch events even in the fullscreen mode? 回答1: [self.view addSubview:btn]; This will add the

Simultaneously downloading and playing a song that is pieced together from multiple URLs

别来无恙 提交于 2019-12-11 12:49:31
问题 I have an NSArray of strings that are URLs. Each URL in the array points to data that is associated with a section of the song. I can play the full song with the following code, which fully downloads the song to a single file then plays it from that file: // Get file path to store song locally NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES); NSString *filePath = [NSString stringWithFormat:@"%@/temp.mp3", [paths objectAtIndex:0]]; // Remove

Set MPNowPlayingInfoCenter duration from AVPlayer?

萝らか妹 提交于 2019-12-11 11:57:47
问题 I am trying to set MPNowPlayingInfoCenter, most of the key-value pairs work fine, but there is some kind of issue with playback time let mpic = MPNowPlayingInfoCenter.defaultCenter() mpic.nowPlayingInfo = [ MPMediaItemPropertyArtwork:albumArtWork, MPMediaItemPropertyTitle:titleString, MPMediaItemPropertyArtist:artistName, MPMediaItemPropertyPlaybackDuration:99, MPNowPlayingInfoPropertyElapsedPlaybackTime:String(stringInterpolationSegment:self.myPlayer.currentItem?.currentTime()),