avplayerviewcontroller

Done button click event in AVPlayerViewController

北战南征 提交于 2019-12-17 12:46:15
问题 I want to play local video in AVPlayerViewController but did not find click event of Done button. My video is able to play in AVPlayerViewController but I did not find next button , previous button and done button click event. 回答1: Officially there is no Done Button click event, a engineer from Apple said about it here. As for my research, I found out that there is one but really indirect way to get an event if Done Button was clicked. I found out that the only variable of

AVPlayerViewController play/pause issue in iOS

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-13 07:37:44
问题 I am working on the iOS application. This application base on the NEWS media. I am playing the small video of highlighted News. I am facing a stranger problem with AVPlayerViewController . When i play the video everything is fine. When i go to offline the buffer video play perfect & after the play buffer video, the video stops but the progress bar(Slider) continuously in play state while the video has been stopped. For more clearance please watch this GIF image : Please visit this link for

AVPlayer/AVPlayerViewController giving warnings when I am trying to play/stop

帅比萌擦擦* 提交于 2019-12-13 04:27:41
问题 When I am playing video form this URL. http://www.html5videoplayer.net/videos/toystory.mp4 I am getting below warnings. let videoURL = URL(string: "http://www.html5videoplayer.net/videos/toystory.mp4") player = AVPlayer(url: videoURL!) iOS:- Here I am using AVPlayer to load URL and play video when I click on play button <2DAD5582-1C08-4D06-8FAF-DDDDE0681EC0>.<9> load failed with error Error Domain=NSURLErrorDomain Code=-999 "cancelled" UserInfo={NSErrorFailingURLStringKey= http://www

Detect tap on / off AVPlayerViewController controls

可紊 提交于 2019-12-12 11:56:50
问题 Based on the answer from this question, I have implemented an event handler that detects when an AVPlayerItem finishes 'naturally'(through AVPlayerItem.DidPlayToEndTimeNotification ) and when it finishes because the user has used the seek bar to reach the end of the video (through AVPlayerItem.TimeJumpedNotification ). I would like to extend this further by checking, in the event handler for the second case, whether the user has stopped seeking - i.e their finger has been lifted from the

Force orientation not working in iOS 10 devices

情到浓时终转凉″ 提交于 2019-12-12 10:05:20
问题 Currently i am doing force orientation change when AVPlayer fullscreen button pressed.I tried something similar final class NewMoviePlayerViewController: AVPlayerViewController { override func viewDidLayoutSubviews() { super.viewDidLayoutSubviews() if contentOverlayView?.bounds == UIScreen.main.bounds{ DispatchQueue.main.async { let value = UIInterfaceOrientation.landscapeRight.rawValue UIDevice.current.setValue(value, forKey: "orientation") } print("full screen") }else{ DispatchQueue.main

Adding an AirPlay Route Button to AVPlayerViewController

﹥>﹥吖頭↗ 提交于 2019-12-11 11:56:45
问题 Is there any way to add an AirPlay Route Button to AVPlayerViewController? I've tried the MPVolumeView trick but that doesn't appear to work with AVPlayerViewController. Thanks in advance. 回答1: If you have airplay devices available, the button will just appear. If you don't see it, make sure you've configured the AVPlayerViewController's AVPlayer to opt in (by setting its allowsAirPlayVideo property). 来源: https://stackoverflow.com/questions/34602354/adding-an-airplay-route-button-to

Add Trick Play feature with AVPlayerViewController in Swift

北城以北 提交于 2019-12-11 10:38:47
问题 I implemented a video player function with AVPlayer in Swift 3. Currently, I can play the video well. I would like to add the feature of " Trick Play " with the speed of 2x,3x,4x . However, I didn't find anything googling. Can anyone help me please? 回答1: Try playerViewController.player!.rate = 2 // 3, 4 etc 来源: https://stackoverflow.com/questions/42973856/add-trick-play-feature-with-avplayerviewcontroller-in-swift

How to add a custom button to AVPlayerViewController?

烈酒焚心 提交于 2019-12-10 16:35:19
问题 Is there any way to add a 'skip 30 minutes back/forward' button to a subclassed AVPlayerViewController so it looks native (just like play/pause button)? 回答1: There is actually no 'good' way of doing it. Apple keeps AVPlayerViewController simple and unfortunately unextensible. The only thing you can do is set a custom overlaying view. But it doesn't solve the problem. And docs say you shouldn't subclass AVPlayerViewController which means you either use it and accept as it is or write your own

Detect if AVPlayerViewController is playing video or buffering and add overlay to the player

孤街浪徒 提交于 2019-12-10 15:24:01
问题 I have to detect whether the video is in playing or buffering mode.I am loading the video from a URL. I have tried the below code and I am able to track after once the video has started playing, but not when it is in buffering state. Also, I want to add an overlay view in my player. I have tried to add the overlay in AVPlayer but when in full screen mode the overlay disappears. Need some suggestions. Thanks in advance. Below is my code: let playerAV = AVPlayerViewController() var player =

How to hide AVPlayerViewController control bar?

房东的猫 提交于 2019-12-10 11:35:39
问题 I've implemented iAd's Preroll Video Ad and I want to guarantee that my user will watch the entire advertisement. How do I hide the AVPlayerViewController 's control bar so the user can not tap "Done" and get out of the video before it finishes? self.canDisplayBannerAds = YES; [AVPlayerViewController preparePrerollAds]; player = [[AVPlayerViewController alloc] init]; player.showsPlaybackControls = NO; player.delegate = self; 回答1: You can use this code to do the same. You need to call play