31 users online (0 members and 31 guests)  


  Results 1 to 11 of 11

Related

  1. Replies: 1
  2. video disappears after refresh    Forum: HTML Forum
    Replies: 2
  3. REFRESH trouble after POST    Forum: HTML Forum
    Replies: 0
  4. Replies: 0
  1. #1
    jeagerjr's Avatar
    New User

    Status
    Offline
    Join Date
    Mar 2008
    Posts
    6

    Rotate Flash video on refresh

    Thanks for reading this thread.

    I have a number of flash movies that I would like to rotate each time the page refreshes. They all have the same specs, just different content.

    What is the best way to do this?

    I do appreciate the advice.

    Regards,

    je

  2. #2
    rangana's Avatar
    Moderator/Allstar

    Status
    Offline
    Join Date
    Feb 2008
    Location
    Cebu City Philippines
    Posts
    317

    Re: Rotate Flash video on refresh

    Do you mean something like this
    HTML Code:
    <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN"
       "http://www.w3.org/TR/html4/strict.dtd">
    <html>
    <head>
    <title></title>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
    <style type="text/css">
    #display {
        width:600px;
        line-height:30px;
        border:3px double #09c;
        font-family:time,serif;
        font-size:16px;
        text-align:center;
        margin:20px auto;
     }
    </style>
    <script type="text/javascript">
    /***********************************************
    * Random Video Script- 
    * Author: Raymond Angana
    * rangana in AHFB2000.com
    * modified last May 2, 2008
    * This notice MUST stay intact for legal use
    ***********************************************/
    var v1,v2,v3,v4,v5,rangVideo;
    /********************************Edit this part for the videos*********************************/
    v1='<object width="400" height="400"><param name="movie" value="http://www.w3schools.com/flash/ball.swf"><embed src="http://www.w3schools.com/flash/ball.swf" width="400" height="400"></embed></object>';
    v2='<object width="400" height="400"><param name="movie" value="http://www.w3schools.com/flash/mouse.swf"><embed src="http://www.w3schools.com/flash/mouse.swf" width="400" height="400"></embed></object>';
    v3='<object width="400" height="400"><param name="movie" value="http://www.w3schools.com/flash/colorchange.swf"><embed src="http://www.w3schools.com/flash/colorchange.swf" width="400" height="400"></embed></object>';
    v4='<object width="400" height="400"><param name="movie"value="http://www.w3schools.com/flash/helloworld.swf"><embed src="http://www.w3schools.com/flash/helloworld.swf" width="400" height="400"></embed></object>';
    v5='<object width="400" height="400"><param name="movie" value="http://www.w3schools.com/flash/button2.swf"><embed src="http://www.w3schools.com/flash/button2.swf" width="400" height="400"></embed></object>';
    /********************************************************************************************/
    rangVideo=[v1,v2,v3,v4,v5]; // This depends on the number of videos you have.
    window.onload=function() 
    {
       rangProc=Math.floor(Math.random()*rangVideo.length);
       document.getElementById('display').innerHTML=rangVideo[rangProc];
     }
    </script>
    </head>
    <body>
    <div id="display">
    </div>
    </body>
    </html>

  3. #3
    jeagerjr's Avatar
    New User

    Status
    Offline
    Join Date
    Mar 2008
    Posts
    6

    Re: Rotate Flash video on refresh

    rangana,

    That's it!!!

    Thank you. I read every thread that goes through here and slowly learning.

    Someday I want to answer questions.

    Thank you very much. It is very much appreciated.

    regards,

    je

  4. #4
    rangana's Avatar
    Moderator/Allstar

    Status
    Offline
    Join Date
    Feb 2008
    Location
    Cebu City Philippines
    Posts
    317

    Re: Rotate Flash video on refresh

    No problem, you're completely welcome

  5. #5
    tommo77funk's Avatar
    New User

    Status
    Offline
    Join Date
    Apr 2009
    Posts
    3

    Re: Rotate Flash video on refresh

    Hi,

    This is great ! thanks for posting this code it is just what I needed. I have one problem though I would like to use it on my wordpress site. It works for me when I put in a html page, but do you happen to know why I cant get it to work on a php site ?

    Many thanks,

    tom

  6. #6
    rangana's Avatar
    Moderator/Allstar

    Status
    Offline
    Join Date
    Feb 2008
    Location
    Cebu City Philippines
    Posts
    317

    Re: Rotate Flash video on refresh

    Please provide a link to your WP page.
    Checkout my porfolio.
    Please click the button when a member helped you.
    Take time to use Forum's Search function.

  7. #7
    tommo77funk's Avatar
    New User

    Status
    Offline
    Join Date
    Apr 2009
    Posts
    3

    Re: Rotate Flash video on refresh

    hi,

    Many thanks rangana, this is the page, it should appear in the box just below the top navigation menu.

    http://www.panoraks.co.uk/

    I inserted the code into a text widget, and have also tried inserting directly into php file, but no joy.

    Thanks so much for your time. I look forward to hearing from you.

    Cheers,

    tom

    p.s. cant post link until I make 5 posts apparently

  8. #8
    rangana's Avatar
    Moderator/Allstar

    Status
    Offline
    Join Date
    Feb 2008
    Location
    Cebu City Philippines
    Posts
    317

    Re: Rotate Flash video on refresh

    There's a conflict of events.

    Try to replace this part:
    Code:
    window.onload=function()
    ...with:
    Code:
    window.addEventListener?window.addEventListener('load',initRandVid,false):
    window.attachEvent('onload',initRandVid);
    function initRandVid()
    Hope that helps.
    Checkout my porfolio.
    Please click the button when a member helped you.
    Take time to use Forum's Search function.

  9. #9
    tommo77funk's Avatar
    New User

    Status
    Offline
    Join Date
    Apr 2009
    Posts
    3

    Re: Rotate Flash video on refresh

    WOW ! Thanks sooooo much !!!! It works, I am delighted, thank you a million times ! I cant tell you how happy I am now

    thanks again,

    tom

  10. #10
    bibigal2009's Avatar
    New User

    Status
    Offline
    Join Date
    Dec 2009
    Posts
    1

    Re: Rotate Flash video on refresh

    Is this javascript work with blogspot?

  11. #11
    KwrIndy's Avatar
    New User

    Status
    Offline
    Join Date
    Jan 2011
    Posts
    1

    Re: Rotate Flash video on refresh

    Hey folks new guy here. Working on church WEB site and they want to rotate the videos they have, but the code is a little confusing on where to place it.

    Below is the HTML page generated by the software we are using. I need some help in knowing where to place this if with in the generated code if possible. Below is what I have so far, but not sure how to set the flashvars.videoPath.

    <script type="text/javascript">
    var flashvars = {};
    var params = {};
    var v1,v2,v3,v4,v5,rangVideo;
    /********************************Edit this part for the videos*********************************/
    v1='<object width="400" height="400"><param name="movie" value="http://www.wgc.org/LAURAPROMO_300k.flv"><embed src="http://www.wgc.org/LAURAPROMO_300k.flv" width="400" height="400"></embed></object>';
    v2='<object width="400" height="400"><param name="movie" value="http://www.wgc.org/CAINSLOUDERBETTER_300k.flv"><embed src="http://www.wgc.org/CAINSLOUDERBETTER_300k.flv" width="400" height="400"></embed></object>';
    rangVideo=[v1,v2]; // This depends on the number of videos you have.
    window.onload=function()
    {
    rangProc=Math.floor(Math.random()*rangVideo.length);
    document.getElementById('display').innerHTML=rangVideo[rangProc];
    }
    /*** Code generated by WEB tool ***/
    flashvars.videoPath = "CAINSLOUDERBETTER_300k.flv";
    flashvars.imagePath = "images/movie_screen.jpg";
    flashvars.title = "";
    flashvars.description = "";
    flashvars.viewInfoButton = "false";
    flashvars.viewFullscreenButton = "false";
    flashvars.viewScaleButton = "false";
    flashvars.viewVolumeControls = "true";
    flashvars.viewTime = "false";
    flashvars.viewBigPlayButton = "false";
    flashvars.videoLoop = "false";
    flashvars.videoAutoPlay = "false";
    flashvars.videoBufferTime = "1";
    flashvars.tlInterval = "1000";
    flashvars.soundVolume = "0.80";
    flashvars.fullSizeView = "2";
    flashvars.spacing = "10";
    flashvars.controlHeight = "25";
    flashvars.volumeLengthW = "100";
    flashvars.color1 = "0xAAAAAA";
    flashvars.color2 = "0x000000";
    flashvars.borderColor = "0x000000";
    flashvars.borderAlpha = "0.5";
    flashvars.timeColor1 = "0x000000";
    flashvars.timeColor2 = "0x000000";
    flashvars.timeAlpha1 = "1.0";
    flashvars.timeAlpha2 = "1.0";
    flashvars.timeTextColor1 = "0xFFFFFF";
    flashvars.timeTextColor2 = "0xC0C0C0";
    flashvars.scrubberHeight = "3";
    flashvars.scrubberColor1 = "0xC0C0C0";
    flashvars.scrubberAlpha1 = "1.0";
    flashvars.scrubberColor2 = "0x0099FF";
    flashvars.scrubberAlpha2 = "1.0";
    flashvars.filterColor = "0x0099FF";
    flashvars.filterAlpha = "0.6";
    flashvars.buttonColor = "0xFFFFFF";
    flashvars.titleColor = "0x47D2FF";
    flashvars.descriptionColor = "0xFFFFFF";
    flashvars.infoBackgroundColor = "0xAAAAAA";
    flashvars.infoBackgroundAlpha = "0.50";
    params.quality = "Best";
    params.scale = "noscale";
    params.wmode = "opaque";
    params.play = "false";
    params.loop = "false";
    params.menu = "false";
    params.allowfullscreen = "true";
    params.salign = "tl";
    swfobject.embedSWF("wb.videoplayer.swf", "FlashVideoPlayer1", "228", "156", "9.0.0", false, flashvars, params);
    </script>

    Thanks in advance,

    Kwrindy



Tags for this Thread