Website 'Media Player'

Discussion in 'OT Technology' started by Jon, Jul 25, 2008.

  1. Jon

    Jon New Member

    Joined:
    Oct 9, 2007
    Messages:
    15,165
    Likes Received:
    0
    Location:
    Connecticut
    Do any of you know if it is possible to make it so if any .wmv / .avi file is clicked on my website, it is automatically loaded either in that window, or in a popup.. instead of prompting user to download?

    People upload files to my website, and want to be able to play the videos right on the site.. instead of having to download.

    :hsd:
     
  2. Limp_Brisket

    Limp_Brisket New Member

    Joined:
    Jan 2, 2006
    Messages:
    48,422
    Likes Received:
    0
    Location:
    Utah
    how the browser deals with .wmv/.avi files is up to the browser and the operating systems default file types. instead of linking directly to the file you can either embed it in the current page or you can have a javascript link that opens a new window with the file embedded in the popup.
     
  3. Jon

    Jon New Member

    Joined:
    Oct 9, 2007
    Messages:
    15,165
    Likes Received:
    0
    Location:
    Connecticut
    i was hoping there may be a chance i could manipulate the way my website handles any url with *.wmv* in it.. maybe using the .htaccess... heh... guess i'll have to do things the hard (right) way...

    thanks
     
  4. Limp_Brisket

    Limp_Brisket New Member

    Joined:
    Jan 2, 2006
    Messages:
    48,422
    Likes Received:
    0
    Location:
    Utah
    well you can link to a script that will output different headers and change the content-type while keeping the file as a wmv but that just helps the browser and OS know what to do with it. examples with php here: http://us3.php.net/manual/en/function.header.php

    ya but if you actually want it to play inside the browser you'll have to embed it.
     
  5. P07r0457

    P07r0457 New Member

    Joined:
    Sep 20, 2004
    Messages:
    28,491
    Likes Received:
    0
    Location:
    Southern Oregon
    short of using a windows media player plugin, java applet, or flash you can't guarantee that function. In the end, the browser decides how to handle it.
     
  6. Jon

    Jon New Member

    Joined:
    Oct 9, 2007
    Messages:
    15,165
    Likes Received:
    0
    Location:
    Connecticut
    That's what I am going to try do do..

    [edit] i sucks, read next post [/edit]
     
    Last edited: Jul 26, 2008
  7. Jon

    Jon New Member

    Joined:
    Oct 9, 2007
    Messages:
    15,165
    Likes Received:
    0
    Location:
    Connecticut
    Okie Dokie... I'm a little stuck (and off to bed so I have given up until tomorrow night after work)

    Dumpy: (or anybody) ... embedding into a php file is easy.. manually... how can I make it so clicking on 'mysite.com/uploaded/ai2a/funnylol.avi' will be rewritten to say... 'mysite.com/streaming/video.php' with the 'funnylol.avi' video embedded into it...

    Or is that too dificult / too much work / not possible?
     
  8. Peyomp

    Peyomp New Member

    Joined:
    Jan 11, 2002
    Messages:
    14,017
    Likes Received:
    0
    You want flash video, man. Its REALLY easy to create a playable .swf (flash) video if you have .flv video, or any kind of video for that matter. Get Flash (the program) and create videos to embed. It will even output the HTML to embed them for you, and you can easily set options for the player like audio controls, FF/rewind, etc.

    Otherwise you just want to embed the video file in HTML. You do not need PHP.

    Do this: <EMBED SRC="filename.???"></EMBED>

    Look up the EMBED HTML docs.

    Here's an example of some audio: <embed width="200" height="30" src="http://dev.myapp.com/static/audio/bob/restaurant.wav"/>
     
  9. Jon

    Jon New Member

    Joined:
    Oct 9, 2007
    Messages:
    15,165
    Likes Received:
    0
    Location:
    Connecticut
    Converting to flv/swf is easy... my problem is I have people uploading .wmv, .avi, .mpg files, and I am trying to see if there is a way to redirect a direct URL if www.mysite.com/video.mpg to something like www.mysite.com/video.php > video.php having code in it to grab that video and play it...

    I think I am complicating things too much.
     
  10. EkriirkE

    EkriirkE Zika Xenu OT Supporter

    Joined:
    Jan 11, 2004
    Messages:
    14,799
    Likes Received:
    0
    Location:
    Dublin & San Francisco, CA
    <EMBED SRC="file.wmv">
     
  11. Peyomp

    Peyomp New Member

    Joined:
    Jan 11, 2002
    Messages:
    14,017
    Likes Received:
    0
    Then I suggest you read my post again, because I included instructions for embedding any kind of video using HTML.

    :squint:
     
  12. Jon

    Jon New Member

    Joined:
    Oct 9, 2007
    Messages:
    15,165
    Likes Received:
    0
    Location:
    Connecticut
    I can embed... my issue was the video is being uploaded, and the url to the file will cause the browser (most likely) to download it...

    I sort of figured this out... but I am having a problem...

    I wanted when a user clicked www.mysite.com/video.avi, it to load in an embedded html/php file...

    The easiest way to do this I figured was using .htaccess...

    I have a php file that when combined with www.mysite.com/video.php?vid=video.avi ... it plays it in the embedded page.

    I then used a rewrite rule in .htaccess to rewrite the url www.mysite.com/video.avi to www.mysite.com/video.php?vid=video.avi...

    Anyway... the video isn't loading when it is redirected using the .htaccess!!

    RewriteRule (.+).avi http://www.mysite.com/video.php?vid=$1\.avi [QSA,L]


    *edited out website name because until i'm finished i dont want it published.
     
  13. Jon

    Jon New Member

    Joined:
    Oct 9, 2007
    Messages:
    15,165
    Likes Received:
    0
    Location:
    Connecticut
    CLIFFS:

    Embedded video = easy and works
    Rewriting link to video to the embedded link = easy? and no works... WtF
     

Share This Page