Video embedding from any video sharing - youtube

I have to design a web app where if you paste the link of particular video page from any video sharing site like "Youtube", "Metacafe" etc it should embed that video in the page. In simple words, what I was asked to do is that I have to embed a video from any site in my page.
Thanx in advance. :)

You can study the embed codes generated by YouTube and MetaCafe etc~ and then code something to mimic how they do it~
It seems like the better solution would be to allow people to paste the embed code generated by the site itself though. Since the hosters' conventions change.

You could Try this:
<iframe height="500" width="500" scr="http://www.youtube.com/embed/videoidentificationnumber/"></iframe>
Dont do this:
<object scr="http://www.youtube.com/embed/videoidentificationnumber"></object>
You will need to make sure that when you click the submit button it gets the identification number from the end and putting it in the bit specified by videoidentificationnumber (I dont know how though).

Related

Playing Youtubes with HTML 5 on iOS

I am trying load a YouTube video into a HTML 5 tag.
The problem I am having is I do not know what the “src” property should be. Using the URL for a video on YouTube does not seem to work, that URL seems to retrieve an entire page rather than just a video file.
I have been able to copy and paste YouTube’s own tag (by viewing the page source), that they use on their pages, but this is not a very efficient or long term solution. Is there a better solution?
I have tried to use YouTube’s API, but no matter what I do, it seems always to pull in the flash player version of the player (which of course won’t work for iOS.) Am I missing something obvious here?
This blog post might help: http://apiblog.youtube.com/2010/07/new-way-to-embed-youtube-videos.html
The suggestion is to use this code:
<iframe class="youtube-player" type="text/html" width="640" height="385"
src="http://www.youtube.com/embed/VIDEO_ID" frameborder="0">
</iframe>
The iframe will autodetect HTML5 capabilities and use them; if not, it uses Flash as fallback.

show html page in iphone application page by page

I want to add feature like epub viewer as similar to ibooks application. So I need to show html or xml or rss feed page in iphone application page wise. What should i do now ?
I worked with webview. But it not shows with page by page. It shows within 1 page.
Let me ask that whether above feature is possible in webview or not ?
If yes then how ?
Do you have any other idea,please share with me.
Please suggest me flow for adding above feature.
It will be great if any one has idea regarding any library or source code .
Thanks
It's not an easy problem, we used some javaScript code to achieve this and called it from obj-c with -stringByEvaluatingJavaScriptFromString(NSString)
And I wasn't able to find any libraries for that.

youtube embed - fullscreen button does not work

recently I discovered issues with embedded youtube videos on my site - the fullscreen-button does not work anymore. It sure did once. The button is visible, but when clicked, nothing happens.
I'm using the Youtube Javascript API to embed videos in my website, much like this example by Google http://code.google.com/apis/ajax/playground/?exp=youtube#simple_embed
I use the fs=1-Parameter to enable the Fullscreen-Button.
If you wanna try this out, just append it to the URL-Parameters in the example and hit "Run Code". It even doesn't seem to work in the Google Code Playground! Is this a general problem or might there be some workaround? I tried this in Chrome, FF and Opera, it's all the same.
My site http://trashnet.de/youloop/?id=HCdkYRx63HM
Best regards :)
Ah, figured it out: you need to set allowFullScreen to 'true'.

I need to embed vimeo or some other html in my rails app

Can someone point me in a direction so that I can use embed code in Rails? Sometimes I need to embed a slideshow pro file and sometimes I need to embed a youtube file and sometimes a vimeo file in the same area for different entries, it would be easiest to use embed code but it keeps stripping the embed code.
Do use a santize plugin? Can someone point me to a tutorial or give me some help to get me started?
thx
Ok, so the plugin was not the answer to my question --
I wanted to simply add embed code to my rails application -- basically in the same area of my site -- sometimes I wanted to add youtube, sometimes, vimeo and sometimes something coming out of slideshow pro director -- a .swf that is fed by an XML feed.
So after a ton of research on this site and many others -- I found there was a simple solution.
escaping html in RAILS.
xss_terminate
http://www.railslodge.com/plugins/910-xss-terminate
xss_terminate is a plugin in that makes stripping and sanitizing HTML stupid-simple. Install and forget. And forget about forgetting to h() your output, because you won't need to anymore.
But xss_terminate is also flexible. By default, it will strip all HTML tags from user input. This is usually what you want, but sometimes you need users to be able to enter HTML. The plugin allows you remove bad HTML with your choice of two whitelist-based sanitizers, or to skip HTML sanitization entirely on a per-field basis.
This plugin did it like a charm -- just remember to remove the h from
<%=h #article.body %> to <%= #article.body %>
Here's a sample rails app with vimeo integration. It looks like it makes use of this great vimeo plugin. From the README:
This gem implements a full-featured
Ruby interface for the Vimeo API v2.
Sounds like it might be just the ticket!
I normally just create a body area_input with RedCloth, this allows for simply drop embedment code inas well as text image etc.

Is there any way to embed a pdf file into an html5 page?

I want to have a web page coded with HTML5, and I want to be able to put a pdf file onto this page so you can view it without having to click on any links to download it separately. Anyone know how to do this?
I want it to keep the text, images, and layout of the pdf file also. If that weren't the case I would just use an image. Thanks!
Edit: This will be hopefully going onto the ipad. So it won't support adobe. I need to just find a way to somehow make the pdf file show up in an html5 page without using a viewer. I want to keep all of its layers. It doesn't have to stay a pdf file when its on the page, I just need to find a way to transfer all of those layers there without having to do this manually with divs for each image, paragraph, etc.
I don't think this is possible without using Flash. Instead, you might want to convert the PDF to a different format (HTML for example) that can be rendered by the browser. There are tools that can do this from the command line, so making a script to do it on your site won't be too difficult.
You can use the embed tag like this:
<embed src="/path/to/your/file.pdf" />
Maybe you could convert the pdf to images on the server and display the images instead of the original pdf. As far as i know, Apache pdfbox can be used to do such a convert.
A little bit late and maybe issuu is gonna fix it soon but for now you can embed with issuu.com using an iframe and your magazine address ending in ?mode=mobile. Tested in ipad:
<iframe width="850px" height="580px" src="http://www.issuu.com/your_username/docs/your_magazine_name?mode=mobile" frameborder="0" allowfullscreen></iframe>
I would like same mobile version loading in desktop so there is no advertising. If you know how to make the browser to think it's an ipad let me know.
This code would directly embed a pdf viewer in a webpage
<object data="path to pdf " type="application/pdf" width="100" height="100">
<p>Alternative text - include a link to the PDF!</p>
</object>
If you are using ASP.NET, this link may be of interest to you.
Browser Based PDF Viewing And Editing
Hosted entirely on your server,
activePDF Portal is an ASP.NET
WebControl that enables your users to
interactively view and modify PDF
documents from any source - adding
comments, form fields, bookmarks, and
more – directly from within a standard
web browser, without requiring any
client-side software such as Adobe
Reader or Flash, or the use of ActiveX
controls.
- http://portal.activepdf.com/
PDFObject looks promising, but it doesn't work on iPads at the moment.

Resources