avkit

Playing a live TuneIn Radio URL iOS Swift

若如初见. 提交于 2019-12-24 08:06:08
问题 I am working on an app which is intended to play life radio by using TuneIn URLs. In TuneIn, there is an http get request in the API which provides a JSON with all the URL and its bitrates. So http://opml.radiotime.com/Tune.ashx?id=s150147&formats=aac,mp3&render=json will return { "head": { "status": "200"}, "body": [ { "element" : "audio", "url": "http://player.absoluteradio.co.uk/tunein.php?i=a664.aac", "reliability": 95, "bitrate": 64, "media_type": "aac", "position": 0, "player_width":

Playing Streaming Video With AVPlayer

不问归期 提交于 2019-12-22 04:29:52
问题 How do you play a streaming video with AVPlayer ? import Cocoa import AVKit class StreamViewController: NSViewController { var videoPlayer: AVPlayer! @IBOutlet weak var moviePlayerView: AVPlayerView! override func viewDidLoad() { super.viewDidLoad() } override func viewWillAppear() { super.viewWillAppear() } override func viewDidAppear() { super.viewDidAppear() openStream() } func openStream() { completeOpenStream { (done) -> (Void) in if done { print("done!") } } } func completeOpenStream

Detecting AVPlayer video start stop events

余生长醉 提交于 2019-12-21 20:13:02
问题 Here is nice simple avplayer piece of code playing a small collection of videos in a queue. My question. I actually want to pause between videos on my queue. Is it possible? I did note that rate fires twice; status fires just once as does notification. import UIKit import AVKit import AVFoundation class ViewController: UIViewController { @IBOutlet weak var VideoView: UIView! var player:AVQueuePlayer = AVQueuePlayer() @IBAction func NextSlide(sender: AnyObject) { player.play() } override func

How to add external WebVTT subtitles into HTTP Live Stream on iOS client

大城市里の小女人 提交于 2019-12-21 17:25:17
问题 We have videos encoded via bitmovin.com and provided as HTTP Live Streams (Fairplay HLS), but subtitles although in WebVTT format are exposed separately as direct URLs for the whole file, not individual segments and are not part of the HLS m3u8 playlist. I am looking for the way how an external .vtt file downloaded separately can still be included in the HLS stream and be available as a subtitle in AVPlayer. I know Apple's recommendation is to include segmented VTT subtitles into the HLS

iPhone simulator plays video, real device won't

六月ゝ 毕业季﹏ 提交于 2019-12-20 03:20:22
问题 I am building an app in Swift on Xcode 7.2 I added a video to my ViewController. Here's the code: import UIKit import AVKit import AVFoundation class GymViewController: UIViewController { var playerViewController = AVPlayerViewController() var playerView = AVPlayer() let fileFemaleURL = NSURL(fileURLWithPath:"/Users/marienkoen/Documents/AppDevelopment/ROZsport/ROZsport/GymFemale-2434.m4v") override func viewDidLoad() { super.viewDidLoad() } @IBAction func playButtonPressed(sender: AnyObject)

Composing Video and Audio - Video's audio is gone

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-20 03:14:35
问题 My question is, I am using the function below, to compose a video and audio. I want to keep video's original sound but it goes away somehow, I do not have any clue. I got this function from this answer I tried to change volumes right after appending AVMutableCompositionTrack s but it did not work For instance; mutableVideoCompositionTrack.prefferedVolume = 1.0 mutableAudioCompositionTrack.prefferedVolume = 0.05 But still, all you can hear is only the audio file. The function; private func

AVPlayer not playing m3u8 from local file

筅森魡賤 提交于 2019-12-19 10:34:23
问题 I am trying to get AVPlayer to play a m3u8 playlist that is a local file. I have narrowed this down to a simple test case using one of Apple's sample playlists: https://tungsten.aaplimg.com/VOD/bipbop_adv_fmp4_example/master.m3u8 If i play this playlist from the remote url, AVPlayer plays this fine. However, if i download this playlist to a local file, and then hand AVPlayer the local file URL, AVPlayer will not play it. It just shows the crossed out play symbol. Interestingly enough, this

AVAssetExportSession exportAsynchronouslyWithCompletionHandler returns failed

末鹿安然 提交于 2019-12-13 02:02:39
问题 I'm implementing AVAssetExportSession to trim a video online but always returns failed. Here is my implementation: NSString *url = @"http://www.ebookfrenzy.com/ios_book/movie/movie.mov"; NSURL *fileURL = [NSURL URLWithString:url]; AVAsset *asset = [AVAsset assetWithURL:fileURL]; AVAssetExportSession *exportSession = [[AVAssetExportSession alloc] initWithAsset:asset presetName:AVAssetExportPresetHighestQuality]; NSURL *exportUrl = [NSURL fileURLWithPath:[documentsDirectory

AVKit.AVPlayerViewController - controls not visible with iOS11 and upwards

戏子无情 提交于 2019-12-12 06:57:19
问题 I have a videoPlayer with controls. These are not visible with iOS11 + no problem up to iOS10 This is a demo with the iPhone8 simulator iPhone 8 Demo This is a demo with the iPhoneX simulator. The controls aren't showing at the bottom of the player iPhone X Demo I believe this has a lot to do with the new safe area. We are using contentOffset (below) to offset from the top. Changing the value makes no difference. No controls visible This is the code below I am using to configure the player :

Should I be using AVKit Player view?

こ雲淡風輕ζ 提交于 2019-12-11 19:33:22
问题 So my app has gone from being a single view to being a navigation controller view + tab bar controller view. Now in my single app view controller I had all this code. // // ViewController.swift // DRN1 // // Created by Russell Harrower on 24/11/19. // Copyright © 2019 Russell Harrower. All rights reserved. // import UIKit import AVKit import AVFoundation import Kingfisher extension UIImageView { func setImage(with urlString: String){ guard let url = URL.init(string: urlString) else { return }