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.
I have parsed the response and here what I get. There is no signature parameter but there is "s". If added to url does not help :(..... Do you have ideas how to fix it?
{ "fallback_host" = "tc.v15.cache7.googlevideo.com"; itag = 18; quality = medium; s = "B86B8669023BB89DDEC0ED2179BA3A7746954A75074.0A667E7EB9245909424C8B399E18A3A7ED90488A88A"; type = "video/mp4; codecs="avc1.42001E, mp4a.40.2""; url = "http://r19---sn-nx57ynez.googlevideo.com/videoplayback?ip=66.183.85.99&key=yt5&mv=m&upn=i5Aqy-Nvebs&source=youtube&sparams=gcr%2Cid%2Cip%2Cipbits%2Citag%2Cratebypass%2Csource%2Cupn%2Cexpire&ipbits=0&ratebypass=yes&gcr=ca&itag=18&mt=1385773291&id=103c1bf6339546d5&ms=au&fexp=919111%2C900504%2C916623%2C936117%2C909717%2C936912%2C936910%2C923305%2C936913%2C907231%2C907240&expire=1385799561&sver=3"; }
What version of XCDYouTubeVideoPlayerViewController are you using? I can play this video just fine.
Please set a breakpoint on this line:
return streamURL;
then once the debugger stops on the breakpoint type this in the lldb console: po video Please paste the output in this issue.
Thank you so much for your response! Here is what I get if I log out "video"
video = {
c = WEB;
"csi_page_type" = embed;
enablecsi = 1;
errorcode = 150;
errordetail = 0;
eventid = W76gUuShD82rjALRnYCwAQ;
loudness = "-26.7589988708";
reason = "This video contains content from WMG. It is restricted from playback on certain sites.
Watch on YouTube";
status = fail;
"storyboard_spec" = "https://i1.ytimg.com/sb/GuJQSAiODqI/storyboard3_L$L/$N.jpg|48#27#100#10#10#0#default#p0DgFfUbcnivGyHWBZPHzHVZJN8|60#45#148#10#10#2000#M$M#eUn1z9YWA07fvqHeoFckHp0jmkw|120#90#148#5#5#2000#M$M#HS5geUTmRWLnrSmQYogHh80XNOI|240#180#148#3#3#2000#M$M#qsrZXqDUU-YclIOPamniuvW1PW8";
}
I am from Canada. But there many other videos that play just fine in other Apps like "itube" or "MusicVideo" for example but do not play in XCDYouTubeVideoPlayer. Mostly because of similar error message. I assume that in the of copyrighted content signature is not returned and other apps parse it out of youtube mobile page. I looked into it and the signature is there. But I did not get time to parse it out and see if it actually works. What is your opinion? How do you think this can be fixed? I really liked your approach and have already integrated your player into my project. But this issue with many videos not playing is a real real headache :(
Does it do this error 4 times? XCDYouTubeVideoPlayerViewController tries to get the video information from 4 different URLs. For me the first one fails (el=embedded) but the second one succeeds (el=detailpage).
Yes, it does try it four different times. But all of them fail because signature is not found.
NSString *signature = stream[@"sig"];
and because signature is always nil it does not populate the streamURLs array.
Do you get signature and can eventually play the above mentioned videos? For example I have just tried playing this one GuJQSAiODqI and it failed to find signature. Failed because I see it is not being returned. There is another param called "s" which resembles signature. But if I use it instead of "sig" it does not help.
Hi Cédric! was my response sufficient? ... I am still struggling with the above mentioned issue. Do you really get the signature and can play the above mentioned video slip? I wonder what is it you do different? Are you running a different version of the project which is not committed into this repository?
Yes, I get the signature and I can play the video just fine. I guess the difference is that I'm connecting from Switzerland and you are connecting from Canada. I already have noticed that YouTube tends to behave differently depending on where you are accessing it from.
Anyway, I have started to work on issue #12 (which appears to be a duplicate of this issue) and initial results are very promising. I still need to cleanup the code and do some more testing. Stay tuned…
Cédric, thank you! This is awesome! I was afraid you are not going to make that fix!
How do I know there is a fix and I can try it? Will I receive an email notification when you push updates?
On Sun, Jan 12, 2014 at 6:21 AM, Cédric Luthi [email protected]:
Yes, I get the signature and I can play the video just fine. I guess the difference is that I'm connecting from Switzerland and you are connecting from Canada. I already have noticed that YouTube tends to behave differently depending on where you are accessing it from.
Anyway, I have started to work on issue #12https://github.com/0xced/XCDYouTubeVideoPlayerViewController/issues/12(which appears to be a duplicate of this issue) and initial results are very promising. I still need to cleanup the code and do some more testing. Stay tuned…
— Reply to this email directly or view it on GitHubhttps://github.com/0xced/XCDYouTubeVideoPlayerViewController/issues/11#issuecomment-32123511 .
I will close this issue once it is solved and you should receive an email if you are subscribed to this thread.
Hi Cédric! How is it going?
I wonder if you had time to look into this issue of playing copyrighted music content? Almost all good video clips are copyrighted and the URL returned cannot be played :(.. I have tried all Youtube players for iOS I could find and they all fail to play this clip for example: https://www.youtube.com/watch?v=G333Is7VPOg
Regular video clips play well but most with Madonna or Britney Spears fail to play... Do you think you can get it playing?
Hey, are you any closer to making this work with VEVO videos? Would be brilliant if it did. Thanks
Hi,
I've noticed that if you just ignore error code 150, many of those videos will still play. You're clearing out the subview on any error, but if you just treat it as a warning and ignore the video will likely still work.
That sounds good.
Copyrighted and mainstream music videos from Vevo, Sony, and WMG work using this method?
@dtp5 no I do not think that letting videos with error code 150 play will play videos from Vevo, Sony, and WMG... there is whole process on how to get it done. But it is very much possible. Still possible... But Google can improve their way of protecting copyrighted content any day.
That's what I am looking for. I'm wondering how third-party apps like Soundwave are able to do this.
Do not know. May be they do the hacking as many other apps do or maybe they have a special agreement with Google.
@jrossfeld I don’t see how you can play a video by ignoring an error with code 150. If you get an error with code 150, there should be no video URL available at all.
As I said, XCDYouTubeVideoPlayerViewController will eventually be able to play all those protected videos but my priority right now is to finish the OS X branch with better unit tests.
Hi,
Please excuse the content (NSFW), but this video was the one that a client reported as having issues and seemed to work after I messed around with it a bit.
https://www.youtube.com/watch?v=f3PJF0YE-x4
Now, I notice it will play ok in your demo app. If you load this up in mobile safari you'll see this:
At first I was getting the 150 code using the master branch, and it would still load the video if I just ignored it. The reason in the error was similar to others that said "This content is owned by..."
Using the most recent code on your osx branch which I just tried also doesn't give me the 150 at all and now plays fine so that seems to solve whatever this particular issue is. I have not dug through the code yet to see what the difference was, but figured I'd report my findings. Perhaps the way they're controlling the content is a little different here.
I'm having problems as well with a video with ID 'VnE6Emx0xxw'. It seems to be for the copyright of the video.