5 ms·
Tell HN: Couldn't Sleep Last Night, Wrote a (No-Flash) HTML5 Viewer for YouTube
- ComputerGuru 17y agoI was bored last night and browsing YouTube in bed on my MacBook, and as usual, when I reached an HD video the fans kicked in and the laptop got hot. Since YouTube now stores the .mp4 version of (most) videos on their servers, I figured it was inevitable that someone had coded something or the other to take advantage of it and view them in streaming format via HTML5 video containers. When I didn't find one I wrote this instead. It's really basic, but it gets the job done. Give it a YouTube link and it'll display the HTML5 video. The userscript adds a link to the HTML5 viewer for all video pages on YouTube.
- NathanKP 17y agoIt looks really nice. I'm giving it a try right now and it doesn't seem to be downloading the video though. I'm using the latest version of Safari on Mac OS X Snow Leopard. I tried Firefox too and still no download. Activity Monitor shows no network activity that would be indicative of it downloading. I tried pressing play to get it started, still nothing. The video that I was attempting to watch: http://neosmart.net/YouTube5/index.php?url=http%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DfVGk5qm6Mac http://neosmart.net/YouTube5/index.php?url=http%3A%2F%2Fwww....
- ComputerGuru 17y agoSeems YouTube's changing the token :S I'm looking into it. EDIT: Found the problem. Need a couple of minutes though. EDIT2: Should be working now. Local testing hadn't shown the IP restrictions in the YouTube link token, fixed now. Thanks for bringing this to my attention, Nathan.
- NathanKP 17y agoYes that got it! Thanks for the quick fix.
- tsuraan 17y agoI'm not having any luck loading your page, so maybe it's explained there, but how do you get to the .mp4 version of a file? pwnyoutube often works, but it's also often down. I'd love to just be able to download the video and watch it locally, if the .mp4 link allows that.
- dreish 17y agojavascript:(function(){url='http://deturl.com/download-video.js';document.body.appendChild(document.createElement('script')).src=url;})(); I've never had a problem using this.
- louislouis 17y agosexy!
- ComputerGuru 17y agoI wrote a quick PHP script that loads the YouTube page and parses the URI, creating a download link from the MP4 link template and various info available in the javascript of that page. Try this link: http://neosmart.net/YouTube5/ http://neosmart.net/YouTube5/
- bingaman 17y agoyoutube-dl.pl http://bitbucket.org/rg3/youtube-dl/wiki/Home http://bitbucket.org/rg3/youtube-dl/wiki/Home
- tsuraan 17y agoThat's pretty nice. Thanks!
- oomkiller 17y agoClickToFlash allows you to download the HD H264 version of the video.
- mseebach 17y agoMay I suggest a GreaseMonkey script that replaces the youtube-flash with the HTML5 video, inline? Like the Safari-plugin mentioned above, but for Firefox.
- aw3c2 17y agoIf possible please make it use no proprietary GreaseMonkey stuff so Opera users can use it as userscript. :) edit: Hey, there is http://neosmart.net/YouTube5/youtube5.user.js http://neosmart.net/YouTube5/youtube5.user.js
- mseebach 17y agoThis doesn't do the replace inline, it just makes a link to the neosmart website which is quite slow at the moment.
- blasdel 17y agoExcept that it's totally infeasible to hack h264 support into Firefox -- they link directly with liboggplay instead of a more wholesome API (portable like ffmpeg's, or native like QT/DirectShow/GStreamer) precisely to keep you from doing so without a ton of pain. They pull ideological bullshit like this all the time (not treating iso8859-1 as cp1252, refusing to do font-face for years, etc). I hope their heads fall off.
- rufo 17y agoIf you haven't seen ClickToFlash yet, it can transparently replace the YouTube flash player with an HTML5 <video> element in Safari: http://rentzsch.github.com/clicktoflash/ http://rentzsch.github.com/clicktoflash/
- swombat 17y agoFrom that link: "Block evil Adobe Flash" Great, more ideologists.
- wtallis 17y agoAren't there enough objectively bad things about Flash to justify summarizing it as "evil"? It does so many bad things to a web site's accessibility, usability, download size, security, and performance that anybody with a genuine interest in making the web a better place should be encouraging migration to the open standards based alternatives. Now that HTML5 features are available, it seems that the only significant things Flash has going for it are a large install base and a decent authoring tool.
- swombat 17y agoThere's enough bad things about almost any good thing... I use Flash (Flex, actually) for my company's website and it works very well for us. Blanket-labelling it as evil is just silly. Flash is no more evil than a hammer.
- pavlov 17y agoA large install base and a decent authoring tool are the sine qua non of online rich media. Silverlight has the latter; HTML 5 will eventually attain a decent install base; but Flash has both now.
- soult 17y agoBut those ideologists are right, Flash is evil in so many ways: a) It eats babies. (Seriously, look at how much CPU and RAM it eats.) b) It's insecure. Want a flaw that even users with a safe browser (ie not IE) are not safe against? Search for a Flash vulnerability. c) It sucks for handicapped people. Blind? Well your bad that you can only use a screen reader. No website for you. (This obviously doesn't matter for video sites). d) Cookies? Lame, if you really want to track your user (or whatever you call the people that watch your ads), even if he clears his browser cache, use Flash cookies. Want to open Popups? Too bad the user has a popup blocker. Oh wait, we can get around that with Flash. d) It's closed source, so many free software people don't want to run it.
- chrischen 17y agoThis is really cool. And I have a question about HTML5 video in general: how would an HTML5 player prevent users from messing with ads if it were used by a site like Hulu?
- swlevy 17y agoGenerally, sites that serve longer video segments (like Hulu) use flash streaming (so the video is not a single file but many fragments served via a special media server), so swapping out the client player would be considerably more difficult.
- kwamenum86 17y agoHTML5 video is not supposed to be used for video streaming at all. I think it is doubtful that companies with the concerns you described would use the video tag.
- rimantas 17y agoWhat makes you think so?
- kwamenum86 17y agoWhat makes me think HTML5 is not for streaming? Streaming video technology works differently. What makes me think companies with the concerns outlined by the OP would not consider HTML5? It would be much more difficult to control their content. Flash is great as a hard to penetrate content container. Exposing your content by using HTML + JS to display it is less than ideal if you want to serve ads/make it difficult to steal content.
- jrockway 17y agoBut of course, you can download full HD TV shows without DRM from other places on the Internet. I consider Hulu proper punishment for people that have never heard of usenet.
- 17y ago
- deleted 17y ago[deleted]
- spazmaster 17y agoVery nice! Just watched Did you Know 4.0 in HTML5 and the activity on the CPU on my MBP was super low, unlike when watching it in Flash. Thanks for staying up the night!
- ComputerGuru 17y agoThank you! and you're welcome :)
- drawkbox 17y agoGoogle/youtube beat you to it in April: http://www.youtube.com/html5 http://www.youtube.com/html5 Must be viewed in Chrome Also show a video of their O3D technology, similar to WebGL.
- ComputerGuru 17y agoThat's just a sample. No way to load other videos in the HTML5 viewer. fyi, the link works great in Safari.
- drawkbox 17y agoTrue. But the player code is all there. It should work in any html5 enabled browser (Safari 4, Chrome, and FF 3.5) although FF 3.5 is having some issues with it. This does highlight one problem with html5 based video, different browsers will interpret it differently no matter how hard standards are pushed. Flash video (FLV) saved us from that and all the horrible players like Real Media, Windows Media and Quicktime by being consistent and working across all browser as long as you have the plugin.
- JMiao 17y agothinking it would be nice if you also let us view a random video link rather than find/copy/paste.
- yesimahuman 17y agoThis seems cool. It's not working for me though, the video never plays and the track scan and volume buttons have a blue border around them. I'm on FF 3.5.5
- ComputerGuru 17y agoYou need to manually press the play button. The numbers are a lie (0:00/0:00) and the blue border only appears in FF (silly thing requires a border=0 which I'll add later). It may take a while on slower internet and some videos do not have an MP4 upload on YouTube. However, the YouTube slider does work and you can use it to skip to any part of the movie.
- kwamenum86 17y agoWow. That sure is a barrage of caveats. Nevertheless, this is awesome. I had the exact same idea last night and I could not sleep either; I put on a movie instead so kudos :) This is a really great idea and based on the shortcomings of Flash you described in your article it sounds like Google should have been doing this anyway. If they can take advantage of a new technology to better serve their users, why not?
- mlLK 17y agoOnly browser I got your app working in was Chrome. What browser were you primarily testing the application in? What version? Because Firefox just released an update this morning and it could very well be the culprit. I not only could not get Firefox (3.5.5), IE7, or Safari to work with your HTML5 YouTube app, but I could not get YouTube's app to work either; I hope this fact mitigates your worries.
- ComputerGuru 17y agoMain development was with Safari, WebKit, Chrome, and Firefox on OS X. Couldn't get it to work with Camino. Tested as well on Chrome for Windows. Of course, Internet Explorer doesn't work. EDIT: Sorry, guess that's the effect of an all-nighter. It actually doesn't load in Firefox for me, either.
- ComputerGuru 17y agoOK, it's going to be super-slow right now because it's already been slashdotted. Don't know why it's taking it down so badly, MySQL has been acting up for the past fortnight :S EDIT: Just swapped services (from Apache to IIS) and it looks like everything's doing better.
- r11t 17y agoHere is a browser bookmarklet for your Youtube HTML5 video viewer : http://gist.github.com/229475 http://gist.github.com/229475
- gcanyon 17y agoOn my macbook, using this viewer causes Safari to take about 20% CPU. Same video using flash takes about 13%. Flash doesn't seem to be CPU-evil on my machine.
- radley 17y agoA crow eating a dead rat? (Zhuangzi)