Results 1 to 6 of 6

Thread: Please tell me this simply...

  1. #1

    Thread Starter
    Evil Genius alex_read's Avatar
    Join Date
    May 2000
    Location
    Espoo, Finland
    Posts
    5,538
    How can I play a sound file when my Html / web page loads please ?

    I guess this would be under the :
    Sub Document_OnLoad()
    event, but I've no idea how to do this.

    Can this work for several media types also please ?
    I may need to change this file in the future, so I'd like to support *.avi, *.mpg & a couple of other standard ones if possible please.

    Thanks for all your help !

    Please rate this post if it was useful for you!
    Please try to search before creating a new post,
    Please format code using [ code ][ /code ], and
    Post sample code, error details & problem details

  2. #2
    Retired VBF Adm1nistrator plenderj's Avatar
    Join Date
    Jan 2001
    Location
    Dublin, Ireland
    Posts
    10,359
    Well to play a sound once when the page loads :

    Code:
    <html>
    <head>
    <title>Some Title</title>
    <bgsound src="file:///C:/jamie/Funnies/TRACTOR1.wav" loop="0">
    </head>
    <body>
    </body>
    </html>
    In terms of playing a movie or whatever, this should do the trick :

    Code:
    <img border="0" dynsrc="file:///C:/jamie/Funnies/fight.avi" start="fileopen" width="168" height="84">
    Ya follow ?

    - jamie
    Microsoft MVP : Visual Developer - Visual Basic [2004-2005]

  3. #3

    Thread Starter
    Evil Genius alex_read's Avatar
    Join Date
    May 2000
    Location
    Espoo, Finland
    Posts
    5,538
    Ya Mon ! I follow,
    That's great cheers !

    Please rate this post if it was useful for you!
    Please try to search before creating a new post,
    Please format code using [ code ][ /code ], and
    Post sample code, error details & problem details

  4. #4
    Retired VBF Adm1nistrator plenderj's Avatar
    Join Date
    Jan 2001
    Location
    Dublin, Ireland
    Posts
    10,359
    To whom shall I address the invoice
    Microsoft MVP : Visual Developer - Visual Basic [2004-2005]

  5. #5

    Thread Starter
    Evil Genius alex_read's Avatar
    Join Date
    May 2000
    Location
    Espoo, Finland
    Posts
    5,538
    Cheques in the post !

    TOUGH ONE I was asked this by a mate, & passed it to this forum. I've just suggested this and have the following puzzing scenario ...

    He's used one of these simple wizard type websites that puts all the HTML code in & makes the website for you.
    They only allow *.avi files to be uploaded for this. His new question, can I connect to HIS PC, rather than using the server the webpage is on. This isn't networked, so I wondered if you could use the PC's IP address instead. so instead of :
    Code:
    src="file:///C:/jamie/Funnies/fight.avi"
    Could you have :
    Code:
    src="file:255.0.0.1///C:/jamie/Funnies/fight.avi"
    Type thing please ?

    Thank you (hope I made some sense there)!

    Please rate this post if it was useful for you!
    Please try to search before creating a new post,
    Please format code using [ code ][ /code ], and
    Post sample code, error details & problem details

  6. #6
    Retired VBF Adm1nistrator plenderj's Avatar
    Join Date
    Jan 2001
    Location
    Dublin, Ireland
    Posts
    10,359
    Well if the system is running PWS or something similar, then he would do :

    Code:
    src="http://127.0.0.1/jamie/Funnies/fight.avi"
    Assuming there is a folder called jamie off the root directory of the webserver.
    He should have pws ; it comes with win98.

    - jamie
    Microsoft MVP : Visual Developer - Visual Basic [2004-2005]

Posting Permissions

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



Click Here to Expand Forum to Full Width