avplayerviewcontroller

AVPlayer doesn't play video until a video from UIImagePickerController is played

左心房为你撑大大i 提交于 2020-03-25 12:34:01
问题 I'm having a problem which I haven't seen a post like it on here. I have an AVPlayerViewController which plays a video based off the path from my Firebase Database (not Storage). The video plays perfectly as I want it to, but only once I watch a video that is clicked on in the UIImagePickerController elsewhere in the app. So for example, the AVPlayer will show a black background (this occurs with all of the AVPlayer's in the app), except for when I watch a video from the

AVPlayer doesn't play video until a video from UIImagePickerController is played

隐身守侯 提交于 2020-03-25 12:32:09
问题 I'm having a problem which I haven't seen a post like it on here. I have an AVPlayerViewController which plays a video based off the path from my Firebase Database (not Storage). The video plays perfectly as I want it to, but only once I watch a video that is clicked on in the UIImagePickerController elsewhere in the app. So for example, the AVPlayer will show a black background (this occurs with all of the AVPlayer's in the app), except for when I watch a video from the

Using an AVPlayer returns a “non-Multipath connection” error

跟風遠走 提交于 2020-03-21 11:24:05
问题 I'm using AVKit to play a youtube URL. I have this code inside a button action: @IBAction func trailerButtonAction(_ sender: Any) { guard let youtubeUrl = youtubeURL else { return } let player = AVPlayer(url: youtubeUrl) let playerViewController = AVPlayerViewController() playerViewController.player = player present(playerViewController, animated: true) { player.play() } } The URL is valid, but when I press the button, the video doesn't stop loading and I'm getting this message on Debug area:

AVPlayer.play() in UITableViewCell briefly blocks UI

早过忘川 提交于 2020-01-12 03:55:12
问题 I’m trying add inline videos to my UITableViewCells a la Instagram, Twitter, Vine…etc. I’m testing out the UI with a local video file using AVPlayerController and a custom cell (see sample code below). I wait for the status of the AVPlayer to be ReadyToPlay and then play the video. The issue is that when scrolling on the tableView the UI freezes for a fraction of section whenever a video cell is loaded which makes the app seem clunky. This effect is made worse when there are multiple video

How to detect fullscreen mode using AVPlayerViewController in Swift?

两盒软妹~` 提交于 2020-01-10 03:11:21
问题 I am trying to detect when the AVPlayerViewController is in full-screen mode, but I'm having a difficult time achieving this. I'd like to know when the user selects the expand button to enter full screen as shown here: I've added the appropriate observer per these suggestions: Detect Video playing full screen in Portrait or landscape How to detect fullscreen mode of AVPlayerViewController The appropriate code: var avWidth:CGFloat = 375 var avHeight:CGFloat = 300 override func viewDidLoad() {

How to embed and stream a video from the web within an Xcode macOS Cocoa Application?

爱⌒轻易说出口 提交于 2020-01-07 04:42:27
问题 I am trying to get my macOS Cocoa Application Xcode project to play some video when I feed it a specified URL. To simplify the question lets just use an empty Xcode project. I want to achieve the same level of control as I am able to get using AVPlayerViewController() in my iOS Single View Application . Within that app I am currently using the solution offered here. However, only the second example works in my macOS Cocoa Application when adapted like so : import Cocoa import AVFoundation

AVPlayerViewController (tvOS) doesn't pause on viewWillDisappear

只谈情不闲聊 提交于 2020-01-04 05:38:05
问题 I have several AVPlayerViewControllers set as the ViewControllers of a UITabBarController . What I want is having the video of the currently visible AVPlayerViewController automatically pause playing when the user switches to another tab (which is another AVPlayerViewController ) I tried this approach: override func viewWillDisappear(animated: Bool) { player?.pause() super.viewWillDisappear(animated) } but the video just keeps running in the background. (audio is still running at least)

iOS 10 AVPlayer will not stream video from URL with no extension and with video/mp4 as content type

泪湿孤枕 提交于 2020-01-02 06:13:28
问题 Currently, we are using a standard AVPlayer via AVPlayerViewController to play video. We are streaming video from a url in the format https://ourdomain/media/mediaid?jwt=authTokenHere. The url, as you can see, has no extension; however the headers are being set on the payload to indicate that the response is a video. Though the links results in the video playing fine in desktop Safari and Chrome, it will not play via iOS's AVPlayer in our application. Is there some particular format that

iOS 10 AVPlayer will not stream video from URL with no extension and with video/mp4 as content type

假如想象 提交于 2020-01-02 06:13:10
问题 Currently, we are using a standard AVPlayer via AVPlayerViewController to play video. We are streaming video from a url in the format https://ourdomain/media/mediaid?jwt=authTokenHere. The url, as you can see, has no extension; however the headers are being set on the payload to indicate that the response is a video. Though the links results in the video playing fine in desktop Safari and Chrome, it will not play via iOS's AVPlayer in our application. Is there some particular format that

In swift, how to detect touch while playing video in AVPlayerViewController

*爱你&永不变心* 提交于 2020-01-02 03:53:05
问题 I have programmatically added an AVPlayerViewController to a UIViewController . I am able to receive the notification when the player is finished playing (playerDidFinishPlaying). I would also like to know if a user has touched the screen while the video is playing and I have not found any related notifications. 回答1: The solution is to create a Base class of AVPlayerViewController and override touches​Began(_:​with:​) method: Swift 2: Custom Base Class: class CustomAVPlayerViewController: