Advanced Search

Results 1 to 2 of 2

Thread: playing videos

  1. #1
    Join Date
    Sep 2007
    Posts
    110
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default playing videos

    hey all
    i was wondering i am very new to java and ajax. How can i load a movie mov,mpeg,avi, etc. into the player without reloading the page? i dont want flash players. i know how to do it with that. any ideas or examples out there i can use? thanks

  2. #2
    Join Date
    Mar 2006
    Location
    Illinois, USA
    Posts
    12,154
    Thanks
    261
    Thanked 690 Times in 678 Posts

    Default

    Flash can be ugly, but this is one case where it has an advantage over any other method. It has the ability to precisely control video content, and... nothing else really does.

    There are some limited ways to control quicktime and I believe real media plugins with Javascript. There may also be some more limited options with window media.
    I think Quicktime has the most, of those.

    However, you're not actually wanting to control the video, just which video. That's not so bad. (That information may be relevant soon, though.)

    Here's the problem:
    Reloading a video isn't like reloading a picture, or, especially, text content.

    Videos are rarely under 1mb and that will take a while to download especially on slower connections.

    So, no, you can't just change it seamlessly.

    There is a workaround, though:
    Load it beforehand.
    This can be done two ways:
    1) Load when requested-- first time it's loaded it will end up stored then you can switch back without problems
    2) Load them all when the page loads

    (1) wastes less bandwidth and can potentially be less for the user to download if they won't be watching every file; (2) will cause a significant delay loading files (and waste bandwidth), but will have no delays after that.

    There have been a few discussions on the subject. Try a search. Might be a bit hard to find, but there's some useful info there.

    Regardless of the above info, you could just change the src using javascript. ( = loading problems, though.)

    I suggest, instead, using an ajax tabs type layout.

    When switching tabs, just remember to mute the audio or pause the video playback. Then you should be fine. (And turn off autoplay.)

    See this script for an example--
    http://www.dynamicdrive.com/forums/s...ad.php?t=22703
    Daniel - Freelance Web Design | <?php?> | <html>| espa˝ol | Deutsch | italiano | portuguŕs | catalÓ | un peu de franšais | some knowledge of several other languages: I can sometimes help translate here on DD | Linguistics Forum

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •