Latest 1.0.1
Homepage https://github.com/advaita13/YouTubeFloatingPlayer
License GNU GPLv3
Platforms ios 9.0
Dependencies youtube-ios-player-helper
Authors

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

Version
License
Platform

Features

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

Requirements

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
}

Dependencies

Example

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

Installation

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 'https://github.com/CocoaPods/Specs.git'

platform :ios, '9.0'
use_frameworks!

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

Then, run the following command:

$ pod install

Usage

Use YTFPlayer.initYTF() method to initialise Player with desired properties.
Once initialised, use YTFPlayer.showYTFView() method with its parameter set to the desired ViewController.

import YouTubeFloatingPlayer

let videoID = "f0NdOE5GTgo"

// Initiates Player with an empty details view
YTFPlayer.initYTF(with: UIView(), videoID: videoID)
YTFPlayer.showYTFView(viewController: self)

// Initiates Player with a tableView with other content
YTFPlayer.initYTF(with: tableView, tableCellNibName: "VideoCell", tableCellReuseIdentifier: "videoCell", videoID: videoID)
YTFPlayer.showYTFView(viewController: self)

// Remove Player
finishYTFView(animated: true)

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

Author

Advaita Pandya, [email protected]

License

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

Latest podspec

{
    "name": "YouTubeFloatingPlayer",
    "version": "1.0.1",
    "summary": "Swift based floating Youtube Player.",
    "homepage": "https://github.com/advaita13/YouTubeFloatingPlayer",
    "license": {
        "type": "GNU GPLv3",
        "file": "LICENSE"
    },
    "authors": {
        "Advaita Pandya": "[email protected]"
    },
    "source": {
        "git": "https://github.com/advaita13/YouTubeFloatingPlayer.git",
        "tag": "1.0.1"
    },
    "platforms": {
        "ios": "9.0"
    },
    "source_files": "YouTubeFloatingPlayer/Classes/**/*",
    "resource_bundles": {
        "YouTubeFloatingPlayer": [
            "YouTubeFloatingPlayer/Resources/**/*.{xib,xcassets,imageset,png}"
        ]
    },
    "dependencies": {
        "youtube-ios-player-helper": []
    },
    "pushed_with_swift_version": "3.0"
}

Pin It on Pinterest

Share This