avplayer

How to handle AVPlayer .AVPlayerItemPlaybackStalled Notification

杀马特。学长 韩版系。学妹 提交于 2020-12-15 09:11:09
问题 I'm using AVPlayer and sometimes the player randomly pauses. I'm observing \.timeControlStatus but the only response I get .paused . I'm also observing \.isPlaybackLikelyToKeepUp , \.isPlaybackBufferEmpty , and \.isPlaybackBufferFull but nothing fires for those. However using Notification.Name.AVPlayerItemPlaybackStalled I do get a print statement that says "stalled". Even though \.rate fires when the the player pauses, that fires before .AVPlayerItemPlaybackStalled fires, sometimes \

How to handle AVPlayer .AVPlayerItemPlaybackStalled Notification

夙愿已清 提交于 2020-12-15 09:05:39
问题 I'm using AVPlayer and sometimes the player randomly pauses. I'm observing \.timeControlStatus but the only response I get .paused . I'm also observing \.isPlaybackLikelyToKeepUp , \.isPlaybackBufferEmpty , and \.isPlaybackBufferFull but nothing fires for those. However using Notification.Name.AVPlayerItemPlaybackStalled I do get a print statement that says "stalled". Even though \.rate fires when the the player pauses, that fires before .AVPlayerItemPlaybackStalled fires, sometimes \

How to handle AVPlayer .AVPlayerItemPlaybackStalled Notification

喜欢而已 提交于 2020-12-15 09:05:34
问题 I'm using AVPlayer and sometimes the player randomly pauses. I'm observing \.timeControlStatus but the only response I get .paused . I'm also observing \.isPlaybackLikelyToKeepUp , \.isPlaybackBufferEmpty , and \.isPlaybackBufferFull but nothing fires for those. However using Notification.Name.AVPlayerItemPlaybackStalled I do get a print statement that says "stalled". Even though \.rate fires when the the player pauses, that fires before .AVPlayerItemPlaybackStalled fires, sometimes \

Swift -check if url asset has sound

我与影子孤独终老i 提交于 2020-12-15 07:17:10
问题 My screen cracked and my phone has no sound capabilities. I recorded a video using the camera. When I select the video url from didFinishPickingMediaWithInfo I tried to check if the video has sound or not but player.currentItem?.asset.tracks says the video does have sound (the device and recorded video definitely has no sound). func imagePickerController(_ picker: UIImagePickerController, didFinishPickingMediaWithInfo info: [UIImagePickerController.InfoKey : Any]) { // ... guard let url =