Forgot your password?
typodupeerror
Media Media (Apple)

Embedding Video In a Site For iPhone/iPod? 68

Posted by timothy
from the how-bosses-expense-ipods dept.
Russ writes "Our corporate media delivery platform is in the process of being refactored (at long, long last), and one of the preferred requirements is the ability to serve streaming video to iPhone and iPod Touch devices, similar to the way YouTube does it — show a screen shot, and when the user taps it, the video should play full-screen and landscaped automatically. The problem comes from the severe lack of documentation Apple provides on how, precisely, this can be done. From what I can tell, YouTube still fires a Flash object to the iPhone despite its lack of Flash support. I have, to a certain extent, been able to review some of YouTube's Flash code and get a hack working on our platform (no screenshot, not landscape, but does play automatically), but I'm sure I'm missing a 'trick of the trade' somewhere that makes the process transparent to the user. Has anyone out there done this before, and if so, how? The standard (and non-standard) Quicktime object/embed codes seem to only provide partial functionality on the iPhone/iPod."
This discussion has been archived. No new comments can be posted.

Embedding Video In a Site For iPhone/iPod?

Comments Filter:
  • WTF? (Score:1, Informative)

    by 4D6963 (933028)

    Since when is Slashdot's front page USENET's macromedia.flash.actionscript [google.com]?

  • by Anonymous Coward on Sunday May 17, 2009 @02:44PM (#27987913)

    Seriously, there are entire web sites dedicated to web programming discussions of this sort.

    • This is because all the followers of The Church of Steve Jobs are promoting anything iphone/apple on firehose.
      • Re:had to happen... (Score:5, Informative)

        by Midnight Thunder (17205) on Sunday May 17, 2009 @06:28PM (#27989357) Homepage Journal

        This is because all the followers of The Church of Steve Jobs are promoting anything iphone/apple on firehose.

        Maybe, but if you step back for a moment, you will also find that the church of Adobe (Flash) and the church of Microsoft (Silverlight0 has an alternative: the church of open standards. As an example, take the following page:

        http://lessig.blip.tv/file/1714232/ [lessig.blip.tv]

        and then simply select "MPEG-4 video" as the format. It plays without any extra magic.

        I may use an iPhone, but I am very pro open standards. Sure anyone can keep a local copy of the MPEG4 file, but this is where Creative Commons comes into play.

      • by Divebus (860563)

        Ballmer? Is that you?

        • Why? Do you think only Ballmer does not like the Church of Steve Jobs? It can also be people who, by some magic of their own, are not affected by RDF.
          • by Divebus (860563)

            No, Ballmer is from the Church of Microsoft and someone who I expect would dilute the positive values of Slashdot with juvenile rage when something they don't understand or can't control is mentioned. Ballmer has his own RDF and it's much larger than Jobs'.

            iPhone!
            iPhone!
            iPhone!
            iPhone!
            iPhone!

            There.

            p.s. I don't have an iPhone either.

    • Well in all honesty, you know what they say about common sense? That it is the rarest commodity on the planet
  • MPEG4 (Score:5, Informative)

    by Anonymous Coward on Sunday May 17, 2009 @02:47PM (#27987931)

    All you need is a direct link to an Apple-compatible MPEG4 video with the correct mediatype on a server that supports the Range HTTP header. The iPhone/iPod's player will automatically start and allow seeking in the video.
    We've been using this technique for a commercial IPTV service for about a year already.

    • by MoFoQ (584566)

      yea, seeqpod was doing this too.
      the iPhone's safari browser would think it was a "youtube" video and will display the logo accordingly

    • by asparagus (29121)

      Along this line, does anybody know of a better way to get iPhone-compatible h264 streams than the Apple Quicktime plugin? I'd like to up the bit rate/quality of my movies [universe42.com] but I have yet to find a solution that works.

      • Try MPEG Streamclip: http://www.squared5.com/ [squared5.com]

        It's free (but not open source); I've been using it for years and am quite happy with it. It has a slew of preset "iPod" export options which are excellent starting points for transcoding stuff to dump into iTunes (and thus a iPod/iPhone) --- you'll also have to refer to Apple's documentation (which I'd have to search for the link...you can google too I'm sure =) if necessary as iPods have limits to things like the bitrate they'll play back, and don't support

      • This is probably off-topic, if so, sorry.

        On the subject of the 264 codec, is that the same one used in Flash? I know the one in Flash is patented but free to use for now. That changes in (I think) April 2010. The patent holders plan to start charging for it's use. They haven't disclosed details of how yet. It may mean that any website streaming Flash content will have to pay for the privilege, so YouTube have a bit of a headache to face. If Apple use the same codec for QuickTime etc their users will face th
    • MPEG4 is certainly the way to go. At this point you could write some Javascript that either checks for the iPhone or lack of Flash capability. The only question is what the best MPEG4 codec is and whether you should optimise the video for streaming?

  • someone didnt bother (Score:5, Informative)

    by Meltir (891449) on Sunday May 17, 2009 @02:51PM (#27987953) Homepage

    to ask the source:

    https://developer.apple.com/safari/library/documentation/AppleApplications/Reference/SafariWebContent/CreatingVideoforSafarioniPhone/chapter_9_section_1.html#//apple_ref/doc/uid/TP40006514-SW1 [apple.com]

    requires a login, etc but if your going to develop for an iphone you might as well save yourself some headbashing and sign up.

  • by way2trivial (601132) on Sunday May 17, 2009 @02:55PM (#27987987) Homepage Journal

    anyone want to tell me how I can duplicate redtube (NSFW in a million years) video thumbnails?

    They are rather excellent, and I aussume automated.....

    • Re: (Score:1, Insightful)

      by Anonymous Coward

      anyone want to tell me how I can duplicate redtube (NSFW in a million years) video thumbnails?

      They are rather excellent, and I aussume automated.....

      Use mencoder to pull out individual frames (one frame a minute or something) and then turn it into a GIF animation. .. not that I know what redtube thumbnails are.

      • by Anonymous Coward on Sunday May 17, 2009 @04:04PM (#27988471)

        Details are always nice... (Yes, there are far more options available!)

        From mplayer:

        mplayer -ss 60 -vo jpeg foo.mpg

        Where:
            -ss 60 starts 60 seconds into the video stream.
            -vo jpeg outputs each frame as a jpeg image with the name 00000000.jpg.

        Pick a bunch of winners... Motion blur can be a problem!

        From ImageMagick:

            convert -delay 10 -loop 0 000000{01,17,23,34,97}.jpg animated.gif

        Where:
          -delay 10 gives one frame every (10/100) or 0.1 seconds.
          -loop 0 makes it repeat endlessly.
          000000{01,17,23,34,97}.jpg are the source images.
          animated.gif is the output file.

        You may also want to use -geometry for resizing (making thumbnails). And perhaps -crop.

    • Re: (Score:2, Informative)

      looks fairly simple:
      script type='text/javascript' src='http://www.redtube.com/thumbchange.js'

      you can see there is nothing fancy, you just use onmouseover to invoke the script (onmouseout to clean up), the rest is just taking snapshots of the video at set times.

    • by vrmlguy (120854)

      Personally, I prefer Shufuni's video thumbnails.

  • by Yvan256 (722131) on Sunday May 17, 2009 @03:17PM (#27988151) Homepage Journal

    http://developer.apple.com/safari/mobile.php [apple.com]

    It's worth signing up for a free account, even if it's only to access Mobile Safari's documentation.

  • by podcast411 (1556541) on Sunday May 17, 2009 @03:33PM (#27988257)
    You can get a free player that you can embed your video into your site and play in flash - yet still works with the iPhone - http://tools.wizzard.tv/ [wizzard.tv] All you need is an RSS feed to make it work. http://tii.libsyn.com/index.php?post_id=407161 [libsyn.com] Here is a link you check from your iphone to see how it works - Scroll down to see the video. Rob W Host - Today in iPhone Podcast
  • by Cyberllama (113628) on Sunday May 17, 2009 @03:49PM (#27988369)

    You can point your non-iphone browser there to get a sense of how its done.

    They've done a splendid job of letting people stream video directly from their site to the iphone simply by having every video on their site converted to Iphone-compatible quicktime (mp4) format. The video quality is even quite a step up from what youtube offers on the iphone.

  • Not quite sure what exactly you are trying to do ... but lets say that your problem is you have embedded flash w/ video and you need iphone/itouch users to be able to access this video too ...

    first thing you will want to do is to do a browser check for 'iPhone' or 'iPod'. You can do this in JS but I prefer to check server side.

    JS would be

    if((navigator.userAgent.match(/iPhone/i)) || (navigator.userAgent.match(/iPod/i))) { code for qt } else { code for flash }

    PHP would be

    if(eregi('iPhone', $_S
    • first thing you will want to do is to do a browser check for 'iPhone' or 'iPod'.

      If you're going to scrap for user agents, at least use 'Mobile Safari, not iPod or iPhone.

      request.user_agent =~ /(Mobile\/.+Safari)/

  • Not really (Score:5, Insightful)

    by 93 Escort Wagon (326346) on Sunday May 17, 2009 @04:07PM (#27988487)

    The problem comes from the severe lack of documentation Apple provides on how, precisely, this can be done.

    Given the number of different links to apple.com web pages already provided in this thread, I'd say the real problem is someone doesn't want to do any reading.

  • SWFObject (Score:2, Informative)

    by wolverine1999 (126497)

    You should be using SWFObject.. it should work with your iphone if it is the latest updated version.

  • RSTP (Score:4, Interesting)

    by sakusha (441986) on Sunday May 17, 2009 @05:13PM (#27988915)

    Streaming QuickTime has been a continual subject of discussion on the QuickTime Streaming Server listserv. Note that I am not referring to progressive download QT, I'm talking about RSTP streaming. Services like YouTube have the ability to detect the maximum bandwidth of the receiving device and deliver a stream encoded for that bitrate. In YouTube's case, they have a custom app that detects whether you're on EDGE or WiFi and delivers a progressive streaming file of higher or lower quality. I have been dissatisfied with the YouTube service, it seems to always stream poorly. And you have to wait and wait for enough of the file to load before it will start playing. Usually my iPhone (even on WiFi) goes to sleep and shuts off long before I can start watching, which aborts the download.

    What the QTSS listserv people are all begging for is true RSTP streaming from QuickTime Streaming Server to the iPhone in Mobile Safari, and an API for apps. QTSS detects your device's bandwidth and delivers a true stream with the appropriate bitrate so it can begin playing instantly, and if you drag the playback slider to any point in the file, it begins playing instantly from that point. This would be a huge advantage, but there is a downside. Since the stream is being delivered continuously on demand, you can't deliver higher bandwidth (higher quality) files that would take a while to download. The file's bitrate may be no more than the channel would allow. But us QTSS users think this is an advantage, I would gladly trade off a little quality for instant-on playback. Another advantage is that QTSS can deliver live video from QuickTime Broadcaster, so live TV events can be delivered live.

    The upshot of the deal is, Apple has not yet enabled RSTP in the iPhone, so it is not available in apps like Mobile Safari. I personally believe (without any evidence) that this is Apple's attempt to cripple Mobile Safari so as to not antagonize AT&T by overloading their network with streaming video. But there are some apps that have RTSP streaming now, there's an app that streams college radio stations (I forgot the name of the app). I don't know how they got it to work, they must have their own RTSP code, it's not in any current iPhone 2.0 OS API.

    I have been telling people for years, if you wanted to start a new TV delivery method, all you'd have to do would be roll out a new line of smartphones with adequate data capacity and live streaming like QTSS. You could start another major network overnight. I've found the quality of TV watching on my iPhone (from my own manually encoded files) to be perfectly fine. But Apple won't enable RTSP on the iPhone... yet. Maybe they have something coming in iPhone OS 3.0, but there hasn't even been a hint of this capacity. Plenty of people are filing the request with the appropriate Apple people, and we get no response whatsoever. Let us hope that no news is good news, and they are not leaking or hinting at anything because they are under an NDA because it's about to roll out.

    • by sakusha (441986)

      Oops, should have previewed and edited that again, of course it is RTSP (Real Time Streaming Protocol) and I always mix it up as RSTP.

    • by Swift2001 (874553)

      I know it's fashionable here to claim that anything that Apple does has an ulterior motive, and maybe it does. But putting Flash on a Mobile device seems problematic.

      But there are lots of streaming apps available for the iPhone, video and audio. There's TV.com, run by CBS, which gives you full episodes of CBS programs, and Star Wars episdoes, too. There's Ustream, and many others.

      They use progressive download of H.264, and TV.com actually streams on 3G, though at lesser quality.

      I don't mind streaming anythi

  • by MosesJones (55544) on Sunday May 17, 2009 @05:28PM (#27989029) Homepage

    Seriously the standard of developers these days seems to have plummeted. If you want to provision for a device go and get the manual for that device, find out that H264 is what you need for the iPhone and that YouTube most certainly does NOT stream flash to iPhones.

    I'm going to put my grumpy old bloke hat on here, but its the same hat I wore when I was 25 and someone asked me how to run Windows apps on an IBM RS6000. That person's excuse was that they just "thought it would work" which was a woeful statement from someone who had a degree in IT. This AskSlashdot is at the same level in that the question boldly states something that ISN'T TRUE (YouTube stream flash) and thinks there is some magic secret.

    There is no magic secret, there is something that shouldn't be considered a secret at all. That thing is called RESEARCH, hell I'm not even asking you to hit the books in a library but just Google YouTube iPhone [google.co.uk] to find a FREE converter that talks about the video differences or YouTube iPhone video codec [google.co.uk]. It really is trivial. And if you can't do that then have a thought about just giving up and using Google Apps Premier Edition for your business and using the commercial version of YouTube that it supplies.

    • by dpu (525864)

      So you know, I wasn't asking about the codec - YouTube seems to have a smooth way of presenting itself to the iPhone and I was looking to replicate it (since YT doesn't publish it's code, obviously). All of our videos are already in h.264 format for use with JW-FLVPlayer (won't work on iPhone) and with the exception of one clients assets, they're all 640x480 or smaller and within the bitrate limit of the iPhone (over WiFi, at least).

      I appreciate your response, but read the entire question next time you feel

      • by MosesJones (55544)

        I did read it and the bit you keep saying is FLASH and FLASH players. That is the bit that if you had used an iPhone you would notice that it is using a QUICKTIME player (i.e. not Flash).

        Having done video for the iPhone myself I have to say that it really is phenomenally trivial and just requires HTML skills and no clever stuff at all. So nope, I'll keep that grump hat on I'm afraid.

    • Seriously the standard of developers these days seems to have plummeted.

      Many of the "questions" and "articles" on slashdot are astroturf designed to get people talking about a particular product. They spam the slashdot editors until something gets through.

      Some of the "respondents" are knowledgeable because they were expecting the "question" and have lots of propaganda lined up to direct the "discussion". Some use sock puppets to mod up the propaganda.

      The questions are naive because they want to make it e

  • by dpu (525864)

    Thanks to those that took a moment for a constructive answer! Turns out that using the embed/object parameters slightly differently solves both the thumbnail and auto-orientation issues.

    The bad thing is that the video object (at least using Quicktime - iPhone Safari doesn't support the HTML5 video tag yet) can't be scripted via Javascript.

    The ADC has absolutely no mention of scripting the iPhone video object via Javascript - it doesn't say it can't be done, but the object doesn't fire any events that I can

    • SWFObject should handle all of this without problems. Indeed there's even a book for the iphone which mentions this, I found by googling... So try it.

      This is the link for swfobject:
      http://code.google.com/p/swfobject [google.com]

      • by dpu (525864)

        We do use SWFObject for publishing the Flash player, but as noted, there is no Flash on the iPhonee, so no, it won't work there.

  • How about simply adding an image with a href that points to embedded media residing in a webserver? Never tried this though...

It is surely a great calamity for a human being to have no obsessions. - Robert Bly

Working...