Skip to main content
40 events
when toggle format what by license comment
Mar 28, 2023 at 17:51 history edited pkis CC BY-SA 4.0
Added separator.
Mar 28, 2023 at 17:45 history edited pkis CC BY-SA 4.0
updated video link
May 18, 2022 at 8:04 comment added Akash Neeli Searching for sample videos? Try this gist.github.com/jsturgis/3b19447b304616f18657
Apr 12, 2019 at 16:02 history edited pkis CC BY-SA 4.0
swift 5 compatible
Mar 6, 2019 at 3:27 history edited chengsam CC BY-SA 4.0
Add missing play method for Objective C
Oct 26, 2018 at 3:59 comment added Manu Thank you for your awesome answer, I'm trying to add the observer from the response below to manage the end of the video and automatically play another one. It has required to expose his didfinishplaying method with @obj-c prefix, but it doesn't trigger anything (not even its alert...) Do you see something I should change from your code or his to add that observer stuff?? thank you :)
Oct 23, 2018 at 22:54 comment added Neal Davis If I remember correctly there is a difference on how you do this on OS X and iOS could someone here outline those differences in using AVPlayerViewController/AVPlayer on OS X versus iOS?
Aug 24, 2018 at 7:02 review Suggested edits
Aug 24, 2018 at 7:52
May 29, 2018 at 9:14 comment added ingconti Tip: controller must be inside NavController sequence to be presented.
S Aug 1, 2017 at 15:56 history suggested CMash CC BY-SA 3.0
Removed unnecessary adding of player view to uiview
Jul 31, 2017 at 14:33 review Suggested edits
S Aug 1, 2017 at 15:56
Jul 24, 2017 at 15:50 comment added Jim75 Objective-C version has an unwanted line (probably a refuse): [self.view addSubview: playerViewController.view] is to be removed;
Jun 8, 2017 at 14:32 history edited pkis CC BY-SA 3.0
added 4 characters in body
May 23, 2017 at 19:00 comment added htafoya The order of the instructions is important, also I needed to import AVKit
Mar 24, 2017 at 10:59 comment added pkis @MayPhyu, not sure about ability of native controls, but you can set it by custom (set: playerViewController.player!.rate = 3). This link: developer.apple.com/reference/avfoundation/avplayer/… can be useful too.
Mar 23, 2017 at 10:05 comment added May Phyu @pkis, Hello bro Do you know trick play (2x, 3x, 4x) speed feature in this AVPlayerViewController with swift 3?
S Mar 15, 2017 at 8:12 history suggested Santo CC BY-SA 3.0
Added line for adding AVFoundation framework as it is must now
Mar 15, 2017 at 6:43 review Suggested edits
S Mar 15, 2017 at 8:12
Mar 14, 2017 at 10:26 comment added pkis @GautamSareriya, i.e. let videoURL = URL(string: "https://devimages.apple.com.edgekey.net/streaming/examples/bipbop_4x3/bipbop_4x3_variant.m3u8")
Mar 14, 2017 at 9:56 comment added Gautam Sareriya @pkis, how to play .m3u8 format video on AVPlayer. And HLS video on AVPlayer?
Mar 7, 2017 at 10:49 history edited pkis CC BY-SA 3.0
Replaced NSURL by URL as more native for swift. Removed swift 2.x code as almost similar and obsolete.
Jan 20, 2017 at 18:21 history edited Andrew Brooke CC BY-SA 3.0
Fixed case sensitive method call
Jan 16, 2017 at 9:00 review Suggested edits
Jan 16, 2017 at 12:00
Jan 10, 2017 at 8:36 comment added ilan for swift 3 this should be: guard let url = URL(string: "clips.vorwaerts-gmbh.de/big_buck_bunny.mp4") else { return } No NSUrl Needed
S Oct 17, 2016 at 18:48 history suggested C0D3 CC BY-SA 3.0
In objective-c need to add the playerViewController to view's subview.
Oct 17, 2016 at 17:12 review Suggested edits
S Oct 17, 2016 at 18:48
Sep 6, 2016 at 14:07 history edited pkis CC BY-SA 3.0
Added swift 3.0 version
Jul 25, 2016 at 10:36 vote accept orazz
Mar 9, 2016 at 19:19 comment added pkis @elliotrock, also don't forget about transport security: stackoverflow.com/questions/31254725/… ,there is a test link: devimages.apple.com.edgekey.net/streaming/examples/bipbop_4x3/…
Jan 11, 2016 at 7:53 comment added pkis @Nick89, AVPlayer works correct with direct links, but if you need to use services like YouTube, Vimeo, etc.(that have indirect links), you should use their own library or SDK. (e.g. for YouTube: guide).
Jan 8, 2016 at 21:23 comment added Nick89 @pkis Thanks for this! Do you know if this should work with youtube links? I'm using Swift with AVPlayerViewController. For example: i've amended the url to be: let videoURL = NSURL(string: "https://youtu.be/d88APYIGkjk"), but all that comes up is a blank AVplayer. it never plays anything from YouTube. If I use the video url you mentioned, it works and plays fine. But I've tried urls from Youtube, IMDB and Apple Movie trailers. But nothing works. Thanks in advance
Dec 2, 2015 at 16:04 history edited pkis CC BY-SA 3.0
deleted 8 characters in body
Dec 2, 2015 at 15:56 history edited pkis CC BY-SA 3.0
added 136 characters in body
Dec 2, 2015 at 15:44 history edited pkis CC BY-SA 3.0
adapted under XCode 7 (swift 2.0)
Oct 14, 2015 at 18:25 comment added Rich Fox Also required import AVFoundation for me
Jul 16, 2015 at 10:57 comment added pkis @Praxiteles, it works on iOS8 or later, maybe it is the reason.
Jul 16, 2015 at 0:03 comment added Praxiteles @pikis Thanks for the code example. Strange, we tried the AVPlayerController as written and get a SIGABRT on: [self presentViewController:playerViewController animated:YES completion:nil];
Jul 15, 2015 at 7:23 history edited pkis CC BY-SA 3.0
Added Objective-C version.
Jul 7, 2015 at 19:53 review Late answers
Jul 7, 2015 at 19:54
Jul 7, 2015 at 19:29 history answered pkis CC BY-SA 3.0