Giter Club home page Giter Club logo

xcdyoutubekit's Introduction

About

Build Status Coverage Status Platform Pod Version Carthage Compatibility Swift Package Manager Compatibility License

XCDYouTubeKit is a YouTube video player for iOS, tvOS and macOS.

Are you enjoying XCDYouTubeKit? You can say thank you with a tweet. I am also accepting donations. ;-)

Donate button

Requirements

  • Runs on iOS 8.0 and later
  • Runs on macOS 10.9 and later
  • Runs on tvOS 9.0 and later

Warning

XCDYouTubeKit is against the YouTube Terms of Service. The only official way of playing a YouTube video inside an app is with a web view and the iframe player API. Unfortunately, this is very slow and quite ugly, so I wrote this player to give users a better viewing experience.

Installation

XCDYouTubeKit is available through CocoaPods, Carthage and Swift Package Manager.

CocoaPods:

pod "XCDYouTubeKit", "~> 2.15"

Carthage:

github "0xced/XCDYouTubeKit" ~> 2.15

Swift Package Manager:

Add XCDYouTubeKit to the dependencies value of your Package.swift

dependencies: [
	.package(url: "https://github.com/0xced/XCDYouTubeKit.git", from: "2.15.0")
]

Alternatively, you can manually use the provided static library or dynamic framework. In order to use the static library, you must:

  1. Create a workspace (File → New → Workspace…)
  2. Add your project to the workspace
  3. Add the XCDYouTubeKit project to the workspace
  4. Drag and drop the libXCDYouTubeKit.a file referenced from XCDYouTubeKit → Products → libXCDYouTubeKit.a into the Link Binary With Libraries build phase of your app’s target.

These steps will ensure that #import <XCDYouTubeKit/XCDYouTubeKit.h> will work properly in your project.

Usage

XCDYouTubeKit is fully documented.

iOS 8.0+ & tvOS (AVPlayerViewController)

AVPlayerViewController *playerViewController = [AVPlayerViewController new];
[self presentViewController:playerViewController animated:YES completion:nil];

__weak AVPlayerViewController *weakPlayerViewController = playerViewController;
[[XCDYouTubeClient defaultClient] getVideoWithIdentifier:videoIdentifier completionHandler:^(XCDYouTubeVideo * _Nullable video, NSError * _Nullable error) {
    if (video)
    {
        NSDictionary *streamURLs = video.streamURLs;
        NSURL *streamURL = streamURLs[XCDYouTubeVideoQualityHTTPLiveStreaming] ?: streamURLs[@(XCDYouTubeVideoQualityHD720)] ?: streamURLs[@(XCDYouTubeVideoQualityMedium360)] ?: streamURLs[@(XCDYouTubeVideoQualitySmall240)];
        weakPlayerViewController.player = [AVPlayer playerWithURL:streamURL];
        [weakPlayerViewController.player play];
    }
    else
    {
        [self dismissViewControllerAnimated:YES completion:nil];
    }
}];

iOS, tvOS and macOS

NSString *videoIdentifier = @"9bZkp7q19f0"; // A 11 characters YouTube video identifier
[[XCDYouTubeClient defaultClient] getVideoWithIdentifier:videoIdentifier completionHandler:^(XCDYouTubeVideo *video, NSError *error) {
	if (video)
	{
		// Do something with the `video` object
	}
	else
	{
		// Handle error
	}
}];

iOS 8.0

On iOS, you can use the class XCDYouTubeVideoPlayerViewController the same way you use a MPMoviePlayerViewController, except you initialize it with a YouTube video identifier instead of a content URL.

Present the video in full-screen

- (void) playVideo
{
	XCDYouTubeVideoPlayerViewController *videoPlayerViewController = [[XCDYouTubeVideoPlayerViewController alloc] initWithVideoIdentifier:@"9bZkp7q19f0"];
	[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(moviePlayerPlaybackDidFinish:) name:MPMoviePlayerPlaybackDidFinishNotification object:videoPlayerViewController.moviePlayer];
	[self presentMoviePlayerViewControllerAnimated:videoPlayerViewController];
}

- (void) moviePlayerPlaybackDidFinish:(NSNotification *)notification
{
	[[NSNotificationCenter defaultCenter] removeObserver:self name:MPMoviePlayerPlaybackDidFinishNotification object:notification.object];
	MPMovieFinishReason finishReason = [notification.userInfo[MPMoviePlayerPlaybackDidFinishReasonUserInfoKey] integerValue];
	if (finishReason == MPMovieFinishReasonPlaybackError)
	{
		NSError *error = notification.userInfo[XCDMoviePlayerPlaybackDidFinishErrorUserInfoKey];
		// Handle error
	}
}

Present the video in a non full-screen view

XCDYouTubeVideoPlayerViewController *videoPlayerViewController = [[XCDYouTubeVideoPlayerViewController alloc] initWithVideoIdentifier:@"9bZkp7q19f0"];
[videoPlayerViewController presentInView:self.videoContainerView];
[videoPlayerViewController.moviePlayer play];

See the demo project for more sample code.

Logging

Since version 2.2.0, XCDYouTubeKit produces logs. XCDYouTubeKit supports CocoaLumberjack but does not require it.

See the XCDYouTubeLogger class documentation for more information.

Credits

The URL extraction algorithms in XCDYouTubeKit are inspired by the YouTube extractor module of the youtube-dl project.

Contact

Cédric Luthi

License

XCDYouTubeKit is available under the MIT license. See the LICENSE file for more information.

xcdyoutubekit's People

Contributors

0xced avatar andreividrasco avatar cwftw avatar javisoto avatar jeehut avatar k06a avatar matteogobbi avatar nikitos9i avatar orkenstein avatar pigeon avatar sixty8 avatar soneejohn avatar voltec avatar waynehartman avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

xcdyoutubekit's Issues

When entering background playback ended

Whenever I press the home button or switch to another app, the active video receives the notification: playback ended. After that when I open up the app again, the video controller turns black and I'm not able to start the video again.

The video is playing in full screen.

The notifications:

Load State: Playable
Load State: Playable | Playthrough OK
Playback State: Playing

(when entering background:)
Playback State: Paused
Finish Reason: Playback Ended

Any idea how to fix this problem?

Using the develop branch

Hi Cédric,

thank you for sharing this great library,

I had problems playing some videos when using the code from master branch, but the problem seems to be solved when I start using the develop branch.

I just have 2 questions:

  1. is there a any problem using the develop code in a production app?
  2. Is there a way to install the develop branch with coca pods?

10x

App crashes if I push the power button while the video is loading.

Hi!

First of all, I really appreciate your great project.

The iOS demo app crashes if I push the power button while the video is loading.

The error message (Thread 1: EXC_BAD_ACCESS(code=1, address=0x0) )
occurred on
"+ (void) backgroundPlayback_applicationWillResignActive:(NSNotification *)notification" method in "MPMoviePlayerController+BackgroundPlayback.m" file.

Even if the app goes to background during the video loading, I hope that I can hear background sound of it.

Thank you for reading this.

Cannot play certain video

Everything else works, but when I try to play the video with the id of oQa8Rv-Vq-Y, it does not work. I have tried in multiple apps, but none of them work. It is a valid YouTube ID.

XCDYouTubeVideoPlayerViewController *videoPlayerViewController = [[XCDYouTubeVideoPlayerViewController alloc] initWithVideoIdentifier:@"oQa8Rv-Vq-Y"];
[self presentMoviePlayerViewControllerAnimated:videoPlayerViewController];

What is going on? My best guess is it because the video ID has a dash in it, but why would that be a problem?

Thanks!

Youtube Player disappears in Table View

In cellForRowAtIndexPath, I have the following code:

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
    static NSString *const cellIdentifier = @"cellIdentifier";
    UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:cellIdentifier];
    if (!cell) {
        cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:cellIdentifier];
    }
        XCDYouTubeVideoPlayerViewController *videoPlayerViewController = [[XCDYouTubeVideoPlayerViewController alloc] initWithVideoIdentifier:@"9bZkp7q19f0"];
        videoPlayerViewController.moviePlayer.shouldAutoplay = NO;
        UIView *video = [[UIView alloc] initWithFrame:CGRectMake(10, 10, 300, 179)];
        [videoPlayerViewController presentInView:video];
        [cell addSubview:video];
    return cell;
}

However, when I try to click a video, it just disappears into the background forever. How do I fix this?

Thank you very much for your time. :)

Cannot play lots of videos

Hi guys!

I use youtube api to search for videos and play them using your approach. Half of videos do not play though some do but many, many do not. For example if I search for keyword "Madonna". But when I try to play those videos using apps like iTube, "Music Video" or "Play Tube" https://itunes.apple.com/ca/app/play-tube-free-player-for/id552248120?mt=8 .... they all play same videos no problem but XCDYouTubeVideoPlayer cannot play them. Can you help me figure how to make XCDYouTubeVideoPlayer play those youtube videos? For example this one: http://www.youtube.com/watch?v=GuJQSAiODqI and there are many other I can give you URLs of.

Most of Videos not getting Video URL

There are many of the videos aren't getting the video info.
There are following videos, not getting the video info.

https://www.youtube.com/watch?v=3O1_3zBUKM8
https://www.youtube.com/watch?v=kHue-HaXXzg
https://www.youtube.com/watch?v=PNu_-deVemE
but we can play this videos in some of the live application. like
https://play.google.com/store/apps/details?id=com.tfsapps.playtube2
https://itunes.apple.com/in/app/itube-playlist-management/id789819758?mt=8

How its possible ??
if I want to play all the videos, so what's the solution ??

UI Control

Hi,

how to customize ui control MPMoviePlayerViewController?

Thank yout

Add support for DASH

I was wondering if you can add support for DASH video for the upcoming version of XCDYouTubeVideoPlayerViewController. Also can you add the functionality of combining the audio and video stream together so this could be able to download a larger variety of videos?
Thanks

I read this: ytdl-org/youtube-dl#1605 (comment)

Specific video doesn't play

Hi Cédric,

The video with the following URL doesn't play: https://www.youtube.com/watch?v=CALtkWA7R_s

I've tracked it down to the method videoURLWithData:error: where no objects are added to the streamURLs dictionary (streamQueries array is not empty though), seems to me the signature for the stream is not found so it skips it, but you'll probably know better.

Any ideas? I tried both master & develop branches

XCDYouTubeVideoQualityHD1080 RETURNING NULL

Hi, I am using XCDYouTubeExtractor (https://github.com/adrientruong/XCDYouTubeVideoPlayerViewController) to get the URL and then download it with Afnetworking. But for the reason the URL for XCDYouTubeVideoQualityHD1080 is always returning null. Here is an example create a simple Mac app and place in this code snippet:

XCDYouTubeExtractor *extractor = [XCDYouTubeExtractor extractorWithVideoIdentifier:@"VpZmIiIXuZ0"];
[extractor startWithCompletionHandler:^(NSDictionary *info, NSError *error) {
  NSLog(@"URL:%@", info[@(XCDYouTubeVideoQualitySmall240)];
}]);

This will return the URL successfully. Now try this:

XCDYouTubeExtractor *extractor = [XCDYouTubeExtractor extractorWithVideoIdentifier:@"VpZmIiIXuZ0"];
[extractor startWithCompletionHandler:^(NSDictionary *info, NSError *error) {
  NSLog(@"URL:%@", info[@(XCDYouTubeVideoQualityHD1080)];
}]);

The URL will be null. I emailed the person who made the extractor, and he said my best bet is to contact the original creator. On another point and this tool get the URLs for audio and 4k?
Thanks,
Sonee John

Issue in iOS 7

I get this issue each time with video on iOS 7 :
_itemFailedToPlayToEnd: {
kind = 1;
new = 2;
old = 0;
}

Everything was okay before the update. I guess something is wrong with one of the library.

Do someone has the same problem ?

Video doesnt have sound

Hi,

I have started using your library, but I have sound can only be heard with headphone, otherwise it doesn´t work.

I have the same behaviour in my app and in your examples.

Maybe there is a special library that I have to include in the project?!

Thx

Issue with App Store Validation

Hi,
we have found that putting XCDYouTubeKit in the app, the IPA fails validation with a message:

The app links to non-public libraries in Payload/..../JavaScriptCore.framework/JavaScriptCore

We added the JavaScriptCore.framework due to iOS 6 support.

Any idea?

Videos returning an error code 0

Hello,

I just updated the to the version 1.2.1 and I'm getting:

Error Domain=XCDYouTubeVideoErrorDomain Code=0 "The operation couldn’t be completed. (XCDYouTubeVideoErrorDomain error 0.)" UserInfo=0x16ed4700 {NSURL=https://www.youtube.com/watch?v=KPcVHY82BAk}

I just saw that when i tried to play a video after trying to play a different one, the error returned was from the previous video, like it was doing some kind of cache..

Thanks,
Newton

XCDYouTubeKit.h - file not found - iOS6

Hi there,

I'm trying to use this on iOS6, but without success yet.
#import <XCDYouTubeKit/XCDYouTubeKit.h> -> file not found.
I've already added the Other Linker Flags.
Could you help?

Thanks.
DR

Youtube Controller disappears suddenly

I'm trying to place the controller on a UITableView's tableHeaderView, using the presentInView: function, but keeps disappearing seconds after appearing the controller.

Can only use XCDYoutubeVideoPlayerViewController in WIFI

I have installed and tested XCDYoutubeVideoPlayerViewController but it doesn't work in 3G on my phone, otherwise it's ok with WIFI connection...

Here is the error in 3G :
Finish Reason: Playback Error
Error Domain=NSURLErrorDomain Code=-1004 "Connexion au serveur impossible." UserInfo=0x14d0e0d0 {NSErrorFailingURLStringKey=https://www.youtube.com/get_video_info?video_id=eOKyj7lgCw4&el=embedded&ps=default&eurl=&gl=US&hl=fr, NSErrorFailingURLKey=https://www.youtube.com/get_video_info?video_id=eOKyj7lgCw4&el=embedded&ps=default&eurl=&gl=US&hl=fr, NSLocalizedDescription=Connexion au serveur impossible., NSUnderlyingError=0x14d58870 "Connexion au serveur impossible."}

Youtube API change?

I've found that videos have stopped playing and believe it is caused by the "sig" element not being returned. Modifying XCDYouTubeVideoPlayerViewController to not require this element causes my videos to play.

diff --git a/EducationGateway/XCDYouTubeVideoPlayerViewController.m b/EducationGateway/XCDYouTubeVideoPlayerViewController.m
index f95de8e..1ec59ed 100644
--- a/EducationGateway/XCDYouTubeVideoPlayerViewController.m
+++ b/EducationGateway/XCDYouTubeVideoPlayerViewController.m
@@ -255,6 +255,11 @@ static void *XCDYouTubeVideoPlayerViewControllerKey = &XCDYouTubeVideoPlayerView
        {
            NSURL *streamURL = [NSURL URLWithString:[NSString stringWithFormat:@"%@&signature=%@", urlString, signature]];
            streamURLs[@([stream[@"itag"] integerValue])] = streamURL;
+        }
+        else if (urlString && [AVURLAsset isPlayableExtendedMIMEType:type])
+        {
+            NSURL *streamURL = [NSURL URLWithString:[NSString stringWithFormat:@"%@", urlString]];
+            streamURLs[@([stream[@"itag"] integerValue])] = streamURL;
        }
    }

Coregraphics errors!

Hi, thanks for the library. Works nice! This works absolutely fine but I get following messages when I present XCDYouTubeVideoPlayerViewController.

: CGContextSaveGState: invalid context 0x0
: CGContextClipToRect: invalid context 0x0
: CGContextTranslateCTM: invalid context 0x0
: CGContextDrawShading: invalid context 0x0
: CGContextRestoreGState: invalid context 0x0

It doesn't crash app but just wondering if you know what could be problem? I am using it on iOS 6.1, iPhone 5.0.

Thanks.

Fails to play video

The lib can't decode the new signature of youtube and fails getting the url.

initWithYoutubeUrl

It would be nice to have an init method that could figure out video identifier from a full youtube url. For a project I am working on, I wrote a category just for that, but maybe others find it useful too and it should be included in XCDYouTubeVideoPlayerViewController source.

Here is my version:

@implementation XCDYouTubeVideoPlayerViewController (Extensions)
- (instancetype)initWithYoutubeUrl:(NSString *)youtubeUrl
{
    NSError *error = NULL;
    NSString *regexString = @"(?<=v(=|/))([-a-zA-Z0-9_]+)|(?<=youtu.be/)([-a-zA-Z0-9_]+)";
    NSRegularExpression *regex = [NSRegularExpression regularExpressionWithPattern:regexString options:NSRegularExpressionCaseInsensitive error:&error];
    NSTextCheckingResult *match = [regex firstMatchInString:youtubeUrl options:0 range:NSMakeRange(0, [youtubeUrl length])];
    if (match) {
        NSRange videoIDRange = [match rangeAtIndex:0];
        NSString *y_video_id = [youtubeUrl substringWithRange:videoIDRange];
        return [self initWithVideoIdentifier:y_video_id];
    }
    return NULL;
}
@end

Locking the iPhone then unlocking makes the Player go black ?

I'm currently loading a video inside a view, however when I make the phone go to sleep and then unlock it the screen goes black, here's a video showing it - http://i.gyazo.com/11d4e2ea476ce89ad7667bf0e10b0489.mp4

Here's my current code

-(void)viewDidLoad {
    [self loadVideo];
}

- (void)loadVideo {
    [self.videoContainerView.subviews makeObjectsPerformSelector:@selector(removeFromSuperview)];

    self.videoPlayerViewController = [[XCDYouTubeVideoPlayerViewController alloc] initWithVideoIdentifier:videoID];




    [[NSNotificationCenter defaultCenter] addObserver: self
                                             selector: @selector(loadStateChanged:)
                                                 name: MPMoviePlayerLoadStateDidChangeNotification
                                               object: self.videoPlayerViewController.moviePlayer];
    [[NSNotificationCenter defaultCenter] addObserver: self
                                             selector: @selector(playBackStateChanged:)
                                                 name: MPMoviePlayerPlaybackStateDidChangeNotification
                                               object: self.videoPlayerViewController.moviePlayer];
    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(MPMoviePlayerDidExitFullscreen:) name:MPMoviePlayerDidExitFullscreenNotification object:nil];
    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(MPMoviePlayerDidEnterFullscreen:) name:MPMoviePlayerDidEnterFullscreenNotification object:nil];


    [[NSNotificationCenter defaultCenter] addObserver:self
                                             selector:@selector(doneButtonClick:)
                                                 name:MPMoviePlayerWillExitFullscreenNotification
                                               object:nil];


        [self.videoPlayerViewController.moviePlayer prepareToPlay];
    //self.videoPlayerViewController.preferredVideoQualities = @[ @(XCDYouTubeVideoQualitySmall240), @(XCDYouTubeVideoQualityMedium360) ];


    [self.videoPlayerViewController presentInView:self.videoContainerView];
    self.videoPlayerViewController.moviePlayer.shouldAutoplay = NO;


    //self.videoPlayerViewController.moviePlayer.initialPlaybackTime = 43;
}

-(void)loadStateChanged:(id)sender
{
    MPMovieLoadState playbackState = [self.videoPlayerViewController.moviePlayer loadState];
    NSLog(@"PlayBackState : %ld", (long)playbackState);
    if((long)playbackState == 0) {
        NSLog(@"Locked phone");
    }

}


-(void)playBackStateChanged:(id)sender
{
    MPMoviePlaybackState playbackState = [self.videoPlayerViewController.moviePlayer playbackState];

    switch (playbackState) {

        case MPMoviePlaybackStateStopped :
            NSLog(@"playbackState: MPMoviePlaybackStateStopped");

            break;

        case MPMoviePlaybackStatePlaying :
            NSLog(@"playbackState: MPMoviePlaybackStatePlaying");
            break;

        case MPMoviePlaybackStateInterrupted :
            NSLog(@"playbackState: MPMoviePlaybackStateInterrupted");
            break;
    }
}

- (void)viewWillDisappear:(BOOL)animated {
}
-(void)viewDidDisappear:(BOOL)animated {
    NSLog(@"Video - VIEW DID DISAPPEAR"); 
}

Also

MPMoviePlaybackStateStopped

gets called when I lock the phone

I'm also using inline player

EDIT: I just downloaded the github project and it's having the same issues.

...
2014-05-21 14:29:06.961 YouTube Video Player Demo[18170:60b] Playback State: Stopped
2014-05-21 14:29:06.962 YouTube Video Player Demo[18170:60b] Load State: N/A
2014-05-21 14:29:06.962 YouTube Video Player Demo[18170:60b] Finish Reason: Playback Ended
...

iOS 6: Navigation Bar image visible beneath Player

When using the player in iOS 6, and with a custom navigation bar background image, the background image of the navigation is visible beneath the player and interferes with the appearance of the player controls.

ios simulator screen shot 8 mar 2014 21 28 36

Automatically starts up video on load

Hi, I came across your video player and every time I present the video it automatically starts up. Is there a way not to do that?

So I made a popup that is presented modally from the root window and inside is a view 'videoView' which contains the youtube video.

XCDYouTubeVideoPlayerViewController *videoPlayerViewController = [[XCDYouTubeVideoPlayerViewController alloc] initWithVideoIdentifier:@"eWbvXB85BZc"];
[videoPlayerViewController.view setFrame:videoView.bounds];
[videoView addSubview:videoPlayerViewController.view];

screen shot 2014-03-10 at 4 10 03 pm

Video thumbnails?

I'm adding support to show the video thumbnail, right now I'm doing it from an external controller.
If you think it'd be interesting to have the functionality in the video player I can try to bake it in, but I don't know if that would add too much complexity for your needs.

VEVO videos

I don't know if there's a fix for this, but I've come across this video: http://www.youtube.com/watch?v=rId6PKlDXeU which doesn't play.

The data in get_info_video contains a string reason=This+video+contains+content+from+VEVO.+It+is+restricted+from+playback+on+certain+sites.

Maybe if there's no fix for playing these restricted videos the player could get the reason and return it as an error?

How to update youtube-dl library?

I want to use the URL exctraction algorithms of the latest youtube-dl.
Could I update youtube-dl library by myself manually? or I have to wait for next XCDYouTubeKit release?

Airplay

Hi, great job !

Is it possible to use Airplay with XCDYouTubeKit ?

Thanks

YouTube API public?

This is awesome is a way that I want to hug you :)

My biggest concern here, is this using YouTube API that could change easily/break, and is that API documented?

Youtube live stream(channel) is not playing

I have problem in playing the live streaming from youtube, can you please help/guide me
how to play the live stream url

For example: https://www.youtube.com/watch?v=xrM34fdmloc&hd=1

Here I am pasting the error log created while running the application:

2014-05-13 20:23:44.436 YouTube Video Player Demo[1348:90b] Finish Reason: Playback Error
Error Domain=XCDYouTubeVideoErrorDomain Code=0 "The operation couldn’t be completed. (XCDYouTubeVideoErrorDomain error 0.)" UserInfo=0x10c03ada0 {NSURL=https://www.youtube.com/get_video_info?video_id=xrM34fdmloc&hd=1&ps=default&eurl=&gl=US&hl=en}
2014-05-13 20:24:09.019 YouTube Video Player Demo[1348:90b] Finish Reason: Playback Error
Error Domain=XCDYouTubeVideoErrorDomain Code=0 "The operation couldn’t be completed. (XCDYouTubeVideoErrorDomain error 0.)" UserInfo=0x10c158d60 {NSURL=https://www.youtube.com/get_video_info?video_id=xrM34fdmloc&hd=1&ps=default&eurl=&gl=US&hl=en}
2014-05-13 20:24:15.241 YouTube Video Player Demo[1348:90b] Finish Reason: Playback Error
Error Domain=XCDYouTubeVideoErrorDomain Code=0 "The operation couldn’t be completed. (XCDYouTubeVideoErrorDomain error 0.)" UserInfo=0x10c14ad50 {NSURL=https://www.youtube.com/get_video_info?video_id=xrM34fdmloc&hd=1&ps=default&eurl=&gl=US&hl=en}
2014-05-13 20:24:24.539 YouTube Video Player Demo[1348:90b] Finish Reason: Playback Error
Error Domain=XCDYouTubeVideoErrorDomain Code=0 "The operation couldn’t be completed. (XCDYouTubeVideoErrorDomain error 0.)" UserInfo=0x10ac6e920 {NSURL=https://www.youtube.com/get_video_info?video_id=xrM34fdmloc&hd=1&ps=default&eurl=&gl=US&hl=en}

Playlist

I have multiple youtube videoID's how can i set it to automatic go to the next videoID? Is there a way where you don't need to dismiss the movieplayer and present a new movieplayer?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.