Latest 2.0.1
License GNU GPLv3
Platforms ios 9.0
Dependencies youtube-ios-player-helper

A Swift-based video player inspired by YouTube. Based on SwiftYouTubeFloatingPlayer.



  • Interactive, drag to minimize, swipe to dismiss
  • Supports TableView as well as any UIView for displaying video details


Currently YTFPlayer is only supported on applications supporting only portrait orientations. To implement the following code must be implemented in the AppDelegate :

func application(application: UIApplication, supportedInterfaceOrientationsForWindow window: UIWindow?) -> UIInterfaceOrientationMask {
    return UIInterfaceOrientationMask.portrait

Known Issues

  • Button Icons do not appear, refer Issue #16 for a fix.



To run the example project, clone the repo, and run pod install from the Example directory first.


CocoaPods is a dependency manager for Cocoa projects. You can install it with the following command:

$ gem install cocoapods

To integrate YouTubeFloatingPlayer into your Xcode project using CocoaPods, specify it in your Podfile:

source ''

platform :ios, '9.0'

target '<Your Target Name>' do
    pod 'YouTubeFloatingPlayer'

Then, run the following command:

$ pod install


Import the library:

import YouTubeFloatingPlayer

Use YTFPlayer.initYTF() method to initialise Player with desired properties.

let videoID = "f0NdOE5GTgo"
// Initiates Player with an empty details view
YTFPlayer.initYTF(with: UIView(), videoID: videoID)
// Initiates Player with a tableView with other content
YTFPlayer.initYTF(with: tableView, tableCellNibName: "VideoCell", tableCellReuseIdentifier: "videoCell", videoID: videoID)

Once initialised, use YTFPlayer.showYTFView() method with its parameter set to the desired ViewController.

YTFPlayer.showYTFView(viewController: self)

Finally, use the finishYTFView() method to remove the Player from the view.

// Remove Player
finishYTFView(animated: true)


Advaita Pandya, [email protected]


YouTubeFloatingPlayer is available under the GNU GPLv3 license. See the LICENSE file for more info.

Latest podspec

    "name": "YouTubeFloatingPlayer",
    "version": "2.0.1",
    "summary": "Youtube-styled Floating Player written in Swift",
    "description": "A floating video player, similar to the one used in the YouTube app, written in Swift 3. This player is interactive in nature: drag to minimize, swipe to dismiss. Furthermore, it supports TableView as well as any other UIView underneath the video player while the player is in normal mode.",
    "homepage": "",
    "license": {
        "type": "GNU GPLv3",
        "file": "LICENSE"
    "authors": {
        "Advaita Pandya": "[email protected]"
    "source": {
        "git": "",
        "tag": "2.0.1"
    "platforms": {
        "ios": "9.0"
    "source_files": "Source/YouTubeFloatingPlayer/Classes/**/*",
    "resource_bundles": {
        "YouTubeFloatingPlayer": [
    "dependencies": {
        "youtube-ios-player-helper": []
    "pushed_with_swift_version": "3.0"

Pin It on Pinterest

Share This