Latest 0.3.0
Homepage https://github.com/hmhv/YoutubePlayer-in-WKWebView
License Apache Copyright 2014 Google Inc. All rights reserved.

Licensed under the Apache License, Version 2.0 (the ‘License’);
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an ‘AS IS’ BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

Platforms ios 8.0, requires ARC
Authors

YoutubePlayer-in-WKWebView version YoutubePlayer-in-WKWebView platform ios 8.0

YoutubePlayer-in-WKWebView is forked from youtube-ios-player-helper For using WKWebView.

Changes from youtube-ios-player-helper

  • class prefix changed to WKYT from YT. YTPlayerView -> WKYTPlayerView
  • using WKWebView instead of UIWebView.
  • getting properties asynchronously.
    // YTPlayerView
    NSTimeInterval duration = self.playerView.duration;

    // WKYTPlayerView
    [self.playerView getDuration:^(NSTimeInterval duration, NSError * _Nullable error) {
        if (!error) {
            float seekToTime = duration * self.slider.value;
        }
    }];

Usage

To run the example project; clone the repo, and run pod install from the Project directory first. For a simple tutorial see this Google Developers article – Using the YouTube Helper Library to embed YouTube videos in your iOS application.

Requirements

Installation

YouTube-Player-iOS-Helper is available through CocoaPods, to install
it simply add the following line to your Podfile:

pod "YoutubePlayer-in-WKWebView", "~> 0.3.0"

After installing in your project and opening the workspace, to use the library:

  1. Drag a UIView the desired size of your player onto your Storyboard.
  2. Change the UIView’s class in the Identity Inspector tab to WKYTPlayerView
  3. Import "WKYTPlayerView.h" in your ViewController.
  4. Add the following property to your ViewController’s header file:
    @property(nonatomic, strong) IBOutlet WKYTPlayerView *playerView;
  5. Load the video into the player in your controller’s code with the following code:
    [self.playerView loadWithVideoId:@"M7lc1UVf-VE"];
  6. Run your code!

See the sample project for more advanced uses, including passing additional player parameters and
working with callbacks via WKYTPlayerViewDelegate.

Author

hmhv

License

YoutubePlayer-in-WKWebView is available under the Apache 2.0 license. See the LICENSE file for more info.

Latest podspec

{
    "name": "YoutubePlayer-in-WKWebView",
    "version": "0.3.0",
    "summary": "YoutubePlayer using WKWebView",
    "description": "Helper library for iOS developers that want to embed YouTube videos inn                         their iOS apps with the iframe player API in WKWebView.",
    "homepage": "https://github.com/hmhv/YoutubePlayer-in-WKWebView",
    "license": {
        "type": "Apache",
        "text": "                              Copyright 2014 Google Inc. All rights reserved.nn                              Licensed under the Apache License, Version 2.0 (the 'License');n                              you may not use this file except in compliance with the License.n                              You may obtain a copy of the License atnn                              http://www.apache.org/licenses/LICENSE-2.0nn                              Unless required by applicable law or agreed to in writing, softwaren                              distributed under the License is distributed on an 'AS IS' BASIS,n                              WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.n                              See the License for the specific language governing permissions andn                              limitations under the License.n"
    },
    "authors": {
        "hmhv": "[email protected]"
    },
    "source": {
        "git": "https://github.com/hmhv/YoutubePlayer-in-WKWebView.git",
        "tag": "0.3.0"
    },
    "platforms": {
        "ios": "8.0"
    },
    "requires_arc": true,
    "source_files": "WKYTPlayerView",
    "resources": "WKYTPlayerView/WKYTPlayerView.bundle"
}

Pin It on Pinterest

Share This