avplayer

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

AVPlayer making extraneous http request prior to playback of HLS / AES-encrypted video

一个人想着一个人 提交于 2020-01-02 06:12:10
问题 We're using AVPlayer on iOS 8.4 to play HLS, AES-encrypted video. Our .m3u8 files include the url of the license server, e.g.: EXT-X-KEY:METHOD=AES-128,URI="https://...." In our iOS application, we're using AVAssetResourceLoaderDelegate method resourceLoader:shouldWaitForLoadingOfRequestedResource: to intercept the request that gets sent by the AVPlayer (or some object within AVFoundation) to the license server. Within that method, we add a token (required by the license server) to the

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:

Using AVPlayer in iOS can you know the current .ts file or the current timestamp from the encoder?

删除回忆录丶 提交于 2020-01-01 12:32:10
问题 Since we are unable to get Closed caption data or subtitle data out of the AVPlayer, we are looking at other trigger methods, such as timecode or at least the knowledge of the .ts file that is currently active. I couldn't find anything in the documentation and the CMTime from the player doesn't give me the timecode that is embedded in the m3u8 files. NSLog(@"%f", CMTimeGetSeconds([mPlayer currentTime] ) ); is not what I'm looking for. #EXTM3U #EXT-X-TARGETDURATION:10 #EXT-X-MEDIA-SEQUENCE:562

Set UISlider.value to AVPlayer.currentTime

拜拜、爱过 提交于 2020-01-01 09:31:55
问题 I am trying to set a UISlider's Value to a AVPlayer's Current Time. I am trying to use this code audioPlayer.currentTime = nowPlayingSlider.value; I am getting this error: Setter method is needed to assign to object using property assignment syntax How do I get this to work. 回答1: Here is how I handled this: -(IBAction) timeScrubberChange:(id) sender{ CMTime t = CMTimeMake(self.nowPlayingTimeScrubber.value, 1); self.nowPlayingCurrentTime.text = [self formatTimeCodeAsString: t.value]; self

AVPlayer fails with AVPlayerItemStatusFailed (OSStatus error -12983)

ぃ、小莉子 提交于 2020-01-01 08:43:13
问题 Sometimes AVPlayer fails with AVPlayerItemStatusFailed and after that failure occurred, AVPlayer continues to failed with AVPlayerItemStatusFailed . I tried to clear the AVPlayer instance and create new one, but I cannot achieve AVPlayerItemStatusFailed failure to solve. Also removingFromSuperview UIView with AVPlayer instance and initializing new item with AVPlayer does not solve the problem. So I figured that out AVPlayer couldn't been cleared completely. Is there anybody suggest anything

AVPlayer fails with AVPlayerItemStatusFailed (OSStatus error -12983)

随声附和 提交于 2020-01-01 08:40:06
问题 Sometimes AVPlayer fails with AVPlayerItemStatusFailed and after that failure occurred, AVPlayer continues to failed with AVPlayerItemStatusFailed . I tried to clear the AVPlayer instance and create new one, but I cannot achieve AVPlayerItemStatusFailed failure to solve. Also removingFromSuperview UIView with AVPlayer instance and initializing new item with AVPlayer does not solve the problem. So I figured that out AVPlayer couldn't been cleared completely. Is there anybody suggest anything

How can i change AVPlayer Video Quality while playing

故事扮演 提交于 2020-01-01 06:56:29
问题 I used this library for playing video from URL , and I am able to play video. Now I want to change the currently playing video quality like (low, medium, high) . Library uses AVPlayer and how can i change quality with AVPlayer? I listen about preferred​Peak​Bit​Rate but I have no idea about it. Please help me how can i do that? 回答1: You cannot set video quality directly on the AVPlayer , however, you can do this by accessing videoComposition property on AVPlayerItem which is then supplied to

MPMusicPlayerController breaks lock screen controls

随声附和 提交于 2020-01-01 06:55:05
问题 I'm attempting to use MPMusicPlayerController to play apple music songs, but I can't get the lock screen controls to work. It seems as though MPMusicPlayerController overridess the remoteControlReceivedWithEvent listener. Here is how I set up my controller: self.player = [MPMusicPlayerController applicationMusicPlayer]; self.player.repeatMode = MPMusicRepeatModeNone; self.player.shuffleMode = MPMusicShuffleModeOff; [self.player beginGeneratingPlaybackNotifications]; [[NSNotificationCenter

Airplay of audio using AVPlayer does not work in the background

◇◆丶佛笑我妖孽 提交于 2020-01-01 05:41:07
问题 I am doing audio playback using the AVPlayer class from a remote URL. It plays fine if I just play to the headphones/built in speaker, but I am seeing some oddities with AirPlay. When I change to use an AppleTV for AirPlay, it will stream the audio, but on my iphone the audio playback indicator (the small 'play' triangle in the top menu bar) disappears, and when I lock the phone instead of continuing in the background, it stops. (When playing normally, it plays in the background fine). Why is