1
votes

I am creating an application in ionic-2 framework base but I am facing issue in playing youtube videos with the youtube iframe api.

I am trying with different videos and creating a build in ionic. I have ran the application in android and iPhone but still the video is showing an error like this:

This video contains content from UMG,SEM & VEVO. It is restricted from playback on certain sites or applications. Watch on youtube

An example video url is "https://www.youtube.com/watch?v=FM7MFYoylVs"

What can I do for this type of error?

Here is a screenshot of the error:

I am attaching a screenshot of this error.

3
This isn't a programming issue but a content license issue from YouTube. Have you tried doing this on a video that isn't copyrighted in certain countries? - Draken
Hello Darken , So what can I do for this you have any idea ? - Karmdip joshi
Not much, YouTube controls how you can view the video and they are saying you cannot view the video in this format. The only way to view the video outside of their app would break their usage policy or similar, so is not allowed. I'm afraid you're stuck with what YouTube does and does not allow. - Draken
yup you're right , I am stuck with this I can play video in my app or I can't . lol - Karmdip joshi

3 Answers

1
votes

As far as i am aware the decision to let the video play on external sites belongs to the video account holder under the Syndication section.

enter image description here

I you want to still play the video in your app you can link it to the YouTube app ( which is a "monetized platform" ) and set the video to open in full screen mode. This will mean communication with the app and in iOS devices i don't think it is pre-installed. You might ( although i have not tried ) tweak the player as soon as you load the video link to be full screen and then redirect back once the video has ended or the user stops the video.

You can view all the tweaks that can be done on the YouTube player API here

Notice the onYouTubeIframeAPIReady() function and the player control options. This will not directly solve your issue but it might be a clean work around to give the impression that the user has not left the app itself.

Otherwise checkout vimeo.

0
votes

Yesterday I sent an email to the YouTube help center and they have replied with the following message and it's clearly telling that the content is copyrighted:

That message is telling you that the video contains copyrighted content, used without permission of the copyright owners. Those entities (Universal Music Group, Sony Music Entertainment, and VEVO) have exercised their right of ownership to control where their property is being used, and they have blocked it from playback on mobile devices and apps. The only way around this error is to find videos that do not use unauthorized (read that as illegal) content.

Link to the question on YouTube

-1
votes

Just use playerVard and place a key @"origin" : @"http://www.youtube.com", You never see this problem again... enjoy ;-)

 NSDictionary *playerVars = @{
                                     @"controls" : @1,
                                     @"playsinline" : @0,
                                     @"autohide" : @1,
                                     @"showinfo" : @1,
                                     @"autoplay" : @0,
                                     @"fs" : @1,
                                     @"rel" : @0,
                                     @"loop" : @0,
                                     @"enablejsapi" : @1,
                                     @"modestbranding" : @1,
                                     @"origin" : @"http://www.youtube.com"

                                     };
    [self.playerView loadWithVideoId:@"JrGBmjtOKlM" playerVars:playerVars];