What I want to do is be able to find instances of YouTube URLs in an NSString (there are often at least 2-3 in each post) and change them to proper YouTube embeds.
The posts that I am downloading are from Wordpress and the site has support for automatically resolving YouTube links for embeds, so when I get them and place them in an NSString they only include the URL which I need to change to show in a WebView.
What would be the best way to achieve essentially wrapping all the existing URLs in YouTube embed code? I honestly can't think up any remotely compact code.
Thanks for any help.
I think you can parse URL content with hpple. How to work with it you can learn here. After parse you can check does link contains "youtube" or something else what do you need. I hope it will help you.
Related
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. :)
This started off as a way to troll my friend but I've kind of gotten interested in this. I wanted to link my friend to a site called stupidtester.com but make it seem like a YouTube video so I researched online how to obfuscate a URL.
After some reasearch I made this:
https://www.youtube.crmwatchv=i4wiZ4fZIDo#%73%74%75%70%69%64%74%65%73%74%65%72.com
I learned I had to take the o out of com and I couldn't use ? after watch?. My first question is why that is.
Secondly, I was wondering if there is a way to make the link even shorter somehow. Forgive me if this sounds stupid, but something like hashing or encrypting the URL so the browser understands the link but to the person clicking it it will look like a normal YouTube video. I ask because my friend said it looked too unrealistic to be a YouTube video.
Have you tried this one
This is googles URL Shortner
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.
I googled a lot about how to make twitter media preview for my website entities if they are linked in a tweet like images below:
Any idea where can I find some documentation about it? Or a tutorial? Is this possible or these media/site previews are hardcoded in twitter?
EDIT:
so, what I need:
If someone links my site on twitter, my widget appear under the tweet, like below:
UPDATE 2012-06-13
It appears this is an Expanded Tweet - -what the requirements are to integrate these expansions into Twitter are do not appear to be displayed - but this sure is interesting.
Nope your in luck. They're not hardcoded into Twitter, they're available in the JSON response. You actually have in your post the word you need to google for entities.
You can add include_entities=1 to the end of most REST api calls and it will give you expanded information about the URL's contained within the JSON. It will split out all the URL's where you can parse out the Youtube links for example. The JSON also includes a special media_url entity but it only works for pictures. In any case, you can still parse out the media easily like youtube with a regex match because you get the URL's split out nicely with this include_entities=1 parameter.
example call :
http://api.twitter.com/1/statuses/user_timeline.json?screen_name=twitterapi&include_entities=1
more documentation : https://dev.twitter.com/docs/tweet-entities
answer edited below based on clarification:
Editing Twitter itself with previews is impossible and it's also ineffective. 75% of traffic to Twitter happens outside of Twitter.com. However the most probable solution to achieving this request would be to download a browser extension.
This extension for example enbales previews of webpages directly in the users stream content preview pane on Twitter.com
https://chrome.google.com/webstore/detail/oijgblonhcagdhfbgjilnpjipmijimmn
I'm totally familiar in making static and dynamic websites.
However, I have never dealt with multimedia in a website.
I want to build a static website that has movies placed on various pages.
The movies will be supplied to me (I will not be making them), I only need to place them on pages.
My questions are...What format (file type) should the movie be in (I am not familiar with Flash, is that a movie type file?, are there others?)
I have the option to tell the people making the movies what type to make. What should I say, and should I include a size range (I'm assuming its sort of like an image file?)
Once I have the above things worked out, I'm assuming I'll have some movie files. Is placing them on a page just like placing image files?
Any help in getting me going is greatly appreciated.
Thanks
Upload them to http://www.blip.tv, and they will give you HTML embeddable code for your site. You can upload mov, wmv, etc, all to Blip. They will convert it for you and handle the dirty-work. All you'll have to do is copy/paste the HTML code they provide.
The best way, in my humble opinion, is to embed video files uploaded to YouTube, Vimeo or other video uploading websites.
This generates HTML for embedding common multimedia types:
http://cit.ucsf.edu/embedmedia/step1.php
You can look at those for guidance.
One problem with Flash movies is they won't play on iPhones.
One word, Youtube
http://help.youtube.com/support/youtube/bin/answer.py?hl=en&answer=132460