avplayerviewcontroller

Change AVPlayerViewController background to album artwork objective-c iOS

大憨熊 提交于 2019-12-23 15:13:28
问题 Is it possible to change the background of an AVPlayerViewController instance when playing audio ? When I lock my device, I can see the music controls with album artwork correctly shown but when the AVPlayerViewController is shown in my app, I can only see the controls with a background representing QuickTime currently playing. Here is how I call it : [[AVAudioSession sharedInstance] setCategory:AVAudioSessionCategoryPlayback error:nil]; NSURL *url=[NSURL fileURLWithPath:clickedPath];

Place AVPlayerViewController inside UIView

感情迁移 提交于 2019-12-23 12:28:52
问题 Currently I am having a dialogue view with four controls at the bottom. Each control is loading a different view inside the dialogue. One of these controls is setting an AVPlayer inside the dialogue view and is playing it. Unfortunately the AVPlayer itself comes without playback controls. The AVPlayerViewController how ever does have playback controls. Is it possible to place a AVPlayerViewController inside a UIView so that it does not get started as a new screen? I would like to place it

How do I replace MPMoviePlayer notifications?

人盡茶涼 提交于 2019-12-22 05:23:20
问题 In iOS 9 MPMoviePlayer and all his components are deprecated. We used MPMoviePlayerController notifications, like MPMoviePlayerLoadStateDidChangeNotification, MPMovieDurationAvailableNotification, MPMoviePlayerPlaybackStateDidChangeNotification, MPMoviePlayerReadyForDisplayDidChangeNotification , to track video service quality. But now with AVPlayerViewController I can't find properly replacement for these notifications. How do I replace these notifications now? 回答1: AVPlayerViewController is

AVPlayerViewController black screen when swiping on iOS 11

你。 提交于 2019-12-22 05:05:32
问题 I'm using AVPlayerViewController to play a video file (H.264, AAC, MP4-Container) on an iPad-App. Everything is working in iOS 10. And also in iOS 11 it plays the video correctly. But in iOS 11, when I start swiping in any direction, it immediately blacks out the video and also mutes audio. It also shows a loading indicator next to the timeline on the bottom. Also it ignores the allowsPictureInPicturePlayback property, so it doesn't show the PIP-Button on iOS 11. This is the code I use:

defining view frame size for AV Player ViewController in ios

[亡魂溺海] 提交于 2019-12-21 19:52:18
问题 How does one play a video as a background in iOS? I followed this question How to play a local video with Swift?, but AV Player ViewController is a controller and doesn't let me decide where and how big the view containing video is. It always takes some predefined values. 回答1: I've got this working for a project that I've done but not with an AVPlayerViewController - just a plain AVPlayer that I add to a view's layer. I have a collection view but you can just insert the video on a layer

AVPlayerViewController in UICollectionViewCell bug?

旧街凉风 提交于 2019-12-21 06:28:19
问题 In my UICollectionView i have a cell. This is my cellForItemAtIndexPath func collectionView(collectionView: UICollectionView, cellForItemAtIndexPath indexPath: NSIndexPath) -> UICollectionViewCell { var videoCell = collectionView.dequeueReusableCellWithReuseIdentifier("cellVideo", forIndexPath: indexPath) as? CollectionViewCell let post = self.arrayOfDetails[indexPath.row] var myUrl = post.image // post.image is image url let fileUrl = NSURL(string: post.image) aPlayer = AVPlayer(URL: fileUrl

AVPlayer crash when resizing window during fullscreen while hotspotting

*爱你&永不变心* 提交于 2019-12-21 03:52:50
问题 I'm coding on an app where uses can watch a wide array of videos. I open the video in fullscreen on button tap and the user is able to use the playback controls to resize the window. The issue I'm having is that when the user is sharing his internet through hotspot there is a blue bar at the top of the app. When resizing the window at this point will cause a crash in the AVKit framework (I believe). Using Swift 2.3, Xcode 7.3.1. My phone, iPhone 6s, uses iOS 10 and I've also tried it on iOS 9

How to play video with cookies content in iOS using AVPlayer in Swift?

二次信任 提交于 2019-12-20 06:48:41
问题 I have used the below implementation to play a video with cookies content from the server, but it shows play icon with cross line. I have refer the link and do following implementation in swift. but I didn't get any output :( func showVideo(url: String) { let videoURL = NSURL(string: url) var cookiesArray = [HTTPCookie]() guard let cookieArray = UserDefaults.standard.array(forKey: Constants.Object.kCookie) as? [[HTTPCookiePropertyKey: Any]] else { return } for cookieProperties in cookieArray

iOS AVPlayer cant play 240 fps video

旧巷老猫 提交于 2019-12-17 20:41:51
问题 I recorded a 240 fps video after changing the AVCaptureDeviceFormat. If I save that video in the photo library, the slowmo effect is there. But, If I play that file from documents directory, using an AVPlayer, I cant see the slowmo effect. Code to play the video: AVPlayerItem *playerItem = [AVPlayerItem playerItemWithAsset:[AVAsset assetWithURL:[NSURL fileURLWithPath:fullPath]]]; AVPlayer *feedVideoPlayer = [AVPlayer playerWithPlayerItem:playerItem]; AVPlayerViewController *playerController =

AVPlayer with playback controls of avplayerviewcontroller

时光怂恿深爱的人放手 提交于 2019-12-17 19:18:49
问题 I am putting n avplayer inside of a view controller to customize some other elements of the view controller but I still want the playback and scrubbing controls used in AVPlayerViewController. Is there a way to enable these controls for the Avplayer when I am not using AvPlayerViewcontroller? 回答1: No. The usual solution (explicitly advised by Apple) is to use the AVPlayerViewController as an embedded view controller - i.e., make your view controller a custom parent view controller and the