xcode 4 stream video check - ios

i am unable to solve this problem and i can´t find any solution elsewhere. I am playing the streaming video from url. But want to check if the url contains any video. Does anyone know how? To be clear i do not want to download the video and then play it. And yes i am checking the internet connection before, so i know if thre is internet or no. Is there any possible way how to check this? i just have URL with String ...i tried it with connection, but the page is connectablebut is blank with no content....:(
Thanks a lot for answer!=)

Now your question didn't say what kind of video you're trying to view, but my guess for the reason the video is blank with no content would be because your iPhone (or simulator) doesn't know how to play video with the encoding that the page contains.
Also, what kind of URL are you using? does it start with the standard http:// scheme, or is it something else like rtmp:// or rtsp:// or audio:// or?
If the URL starts with only http://, the only way that I can think of to check for a video stream is to download the html source from that page and scan through it looking for stream protocols (such as the ones I've listed above).

Related

Disabling Youtube autoplay when providing a URL link

I need to provide people with a URL link to some of my Youtube videos, but I don't want Youtube to then automatically display some random video that it thinks should be "up next". There's nothing more embarrassing than trying to show people your work and then up pops a ridiculous video that they think must be yours as well.
I've tried tacking on "&autoplay=false" and "&autoplay=0" to the end of the URL, but that doesn't work.
Anyone know what needs to be done?
You can send people an embed link that shows the video only. I think in your case this would be fine, but for anyone that requires comments, it would be an issue. Also adding ?rel=0 will stop the end card from showing related videos from another users channel.
https://www.youtube.com/embed/OefocRFlDss?rel=0
A list of embed params can be found here: https://developers.google.com/youtube/player_parameters
I guess that's not possible, but maybe you could embed that video via API to some server you own, and disable the suggestions.
Check this documentation for disabling, controls and siggestions.
https://developers.google.com/youtube/player_parameters#autoplay
Or this: http://illuminea.com/remove-related-videos-from-end-of-embedded-youtube-video/
Luck!
This feature does not seem to be customizable from the url; it's more of a user setting. You can find here some details about how to turn it off for yourself but you cannot control the way it will behave for others.
Also, I'm not sure if this question qualifies as a programming one. :)

Why the link get from youtube get_video_info doesn't work for download?

I test with browser with the link I get from "http://www.youtube.com/get_video_info?&video_id=xx" to see if it is be able to download.
After remove some parameters from original link, some works but some still don't.
I read some post here but most of are pretty old. A lot of change since then.
I wonder if there are somebody working on this recently.
The purpose I need this is because my youtube view program need a better quality video to display.
This is link doesn't work:
http://r17---sn-tt17rn7e.c.youtube.com/videoplayback?fexp=902529%2C932000%2C906383%2C902000%2C919512%2C929903%2C931202%2C900821%2C900823%2C931203%2C931401%2C908529%2C919373%2C930803%2C906836%2C920201%2C929602%2C930101%2C930603%2C900824%2C910223&ipbits=8&expire=1364854787&sver=3&mt=1364829200&newshard=yes&id=26c94a41dba396f5&key=yt1&upn=GrcnDUPfreQ&cp=U0hVSVhQUl9NUUNONV9QSlZIOm9BbnVkMTJzOXE5&sparams=algorithm%2Cburst%2Ccp%2Cfactor%2Cid%2Cip%2Cipbits%2Citag%2Csource%2Cupn%2Cexpire&ip=173.248.214.165&itag=34&ms=au&source=youtube&mv=m&signature=9593596F58B377FAA4C8F5A4516C7F53CE473340.507CA2EA250CEED2E2B2377FD70EE1A0478EE322&type=video/mp4; codecs="avc1.42001E, mp4a.40.2"&itag=18&
What wrong with it? I removed fallback_path and replace sig with signature.
The working link is for webm. This is for h264. Both have the same kind of parameters.
And this is working now.
http://r17---sn-tt17rn7e.c.youtube.com/videoplayback?fexp=909708%2C912514%2C930802%2C932400%2C916624%2C931009%2C932000%2C906383%2C902000%2C919512%2C929903%2C931202%2C900821%2C900823%2C931203%2C931401%2C908529%2C930807%2C919373%2C906836%2C920201%2C929602%2C930101%2C930603%2C900824%2C910223&ms=au&itag=44&mt=1364825784&ipbits=8&cp=U0hVSVhQT19NUUNONV9QSlNCOlp5ZGoyMXJ3emlq&ip=173.248.214.165&upn=ohH0s8EjPyo&newshard=yes&source=youtube&ratebypass=yes&mv=m&sparams=cp%2Cid%2Cip%2Cipbits%2Citag%2Cratebypass%2Csource%2Cupn%2Cexpire&id=26c94a41dba396f5&expire=1364851187&key=yt1&sver=3&signature=798EED35782B846D2B0EA190A17E837A0DBA18EA.AD56BCF6365AAD974C18F09F352F9422084C50AC&type=video/webm; codecs="vp8.0, vorbis"&quality=large,itag=35&
That's not a supported method of interacting with YouTube. You need to use one of the official YouTube Player mechanisms to display YouTube videos.
Please familiarize yourself with the YouTube API Terms of Service if you have any more questions.

How to get video download link from youtube?

I searched far and wide and came up with nothing.
Ok, that is not completely true, there are in fact tons of solutions on the Internet (even here on stackoverflow) on how to get a download link for youtube video, but not a single one of them is working anymore, since youtube seems keep changing things all the time.
What I want to do, is to write a PHP script which will be able to download video from specified youtube page and then save it on the server in flv or mp4 format.
I can get some video information by downloading this: http://www.youtube.com/get_video_info?&video_id=VIDEO_ID
But thats about it, no matter what I do, I just cannot figure out how find the link pointing to the video download.
I tried to use this link: http://youtube.com/get_video?video_id=VIDEO_ID&t=TOKEN&fmt=18&asv=2 from one more recent solution I found, but either there is something missing in it, or it's completely outdated already too.
So how can I dig out some working link for direct video download from youtube?
There has to be some way to do it, since there are some web pages out there which provide this service.
Thank you for any advices.
I prefer RealPlayer to download videos from youtube and other video sharing sites like metacafe, funnyordie and others. You're able to download in both mp4 or flv format, save them, and view them whenever you'd like.. even if you're not online which is great for travel. http://www.real.com/realdownloader

How to know if a link is a video? [duplicate]

This question already has answers here:
Closed 11 years ago.
Possible Duplicate:
How to determine if a given URL link is a video or image?
I'm building a forum and I want the facebook feature whereby when the user paste a video URL, i can automatically know its a video and display it differently??
You can check it's "mime type".
The way Facebook implemented requires quite a lot of computing power and may not be suitable for small scaled website.
After the user input the video URL, Facebook will proceed to determine if the URL belongs to a known host (such as Youtube, CollegeHumour). If the URL does not belong to a known host, Facebook will proceed to retrieve the page and determine the video parameters from the <meta> tags, according to what Facebook defines them to be.
However to keep things easy for you, maybe your forum can determine that if the URL is from Youtube, you can use Youtube's embed code to display the video.
This does not deal with MIME types, or video files directly. If it is video files, you will still need to proceed to fetch the headers of the video file, and determine what plugin or Flash player should display the video.

Determine whether a YouTube video cannot be embedded in a specific site

This YouTube video can be embedded into most sites (e.g., Stackoverflow), but it cannot be embedded into Rap Genius. You can try it yourself by pasting the embed code in to Rap Genius with firebug. You'll see this:
I need a way to detect whether a video is specifically blocked from Rap Genius.
Note that this is different from checking whether a video cannot be embedded anywhere – i.e., if you GET http://gdata.youtube.com/feeds/api/videos?v=2&alt=jsonc&q=_kmeFXjjGfk, you'll see that in the JSON response, data.items[0].accessControl.embed == 'allowed'
One clue: before the video starts playing, the player makes a request to a URL that looks like this:
http://www.youtube.com/get_video_info?video_id=_kmeFXjjGfk&el=embedded&ps=default&eurl=http%3A%2F%2Frapgenius%2Ecom&hl=en_US
Which, when curled, gives this response:
status=fail&errorcode=150&reason=This+video+contains+content+from+UMG%2C+who+has+blocked+it+from+display+on+this+website.%3Cbr%2F%3E%3Cu%3E%3Ca+href%3D%27http%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3D_kmeFXjjGfk%26feature%3Dplayer_embedded%27+target%3D%27_blank%27%3EWatch+on+YouTube%3C%2Fa%3E%3C%2Fu%3E&fslarge=1
So maybe I can just query this URL? Will this work in all cases? Is there an "official" way of doing this?
I had the error:
This video contains content from XXX
I noticed I was using https when requesting the page containing the embedded video. Switching back to http seems to have fixed the problem.
You have all the info in http://gdata.youtube.com/feeds/api/videos?v=2&alt=jsonc&q=_kmeFXjjGfk
"status":{"value":"restricted","reason":"limitedSyndication"},"restrictions":[{"type":"country","relationship":"deny","countries":"DE"}]
March 19, 2013 -- Response is now quite different than that given above:
{"apiVersion":"2.1","data":{"updated":"2013-03-19T14:47:14.533Z","totalItems":0,"startIndex":1,"itemsPerPage":25}}

Resources