A Swift floating/draggable player like YouTube that remains on top of all screens until it's removed. Based on PlayerView and DraggableYoutubeFloatingVideo.
Currently YTF view is only supported on applications supporting only portrait orientations. To implement that you must put this in your AppDelegate:
func application(application: UIApplication, supportedInterfaceOrientationsForWindow window: UIWindow?) -> UIInterfaceOrientationMask {
return UIInterfaceOrientationMask.Portrait
}
Copy Classes and Resources folders to your project.
Pass a NSURL or [NSURL], customize the tableView on YTF view adopting delegate and dataSource in your ViewController before passing them as parameters and also provide a nib for cell customization:
YTFPlayer.initYTF(urls, tableCellNibName: "MyCell", delegate: self, dataSource: self)
Show YTF view passing a ViewController:
YTFPlayer.showYTFView(self)
Remove YTF view animated(true) or not(false):
YTFPlayer.finishYTFView(true)
souana, [email protected]
SwiftYouTubeFloatingPlayer is available under the MIT license. See the LICENSE file for more info.