Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Garry Bain 149 posts 124 karma points
    Jan 11, 2010 @ 14:11
    Garry Bain
    0

    Weird behaviour for playing Flash Videos

    Hi everyone,

    I currently modified the Simple Video Player package - which simply plays flash videos via inserting a macro. However, I'm getting a really odd bug - when you visit the site the video will not play - but it will then play if you refresh the page. The actual occurence of the bug is quite unpredictable - you can see the videos playing on each page then all of a sudden they won't load. I have checked permissions and everything seems ok - I have a feeling it might be the Javascript not executing properly in the XSLT file. Here is the site:

    http://demo.sdesign1dev.co.uk

    If the video does load first time, then click around a few pages and you'll notice them stop loading all of a sudden. Are there any known bugs surrounding JavaScript in XSLT or video playback?

    Thanks, Garry.

  • dandrayne 1138 posts 2262 karma points
    Jan 11, 2010 @ 14:32
    dandrayne
    0

    Seems to be throwing a js error that

    callFlashPlayPauseVideo()

    Is not defined.  I notice you're using jquery, why not throw this call into document.ready instead of body onload?

    Dan

     

  • Garry Bain 149 posts 124 karma points
    Jan 11, 2010 @ 14:37
    Garry Bain
    0

    Hi Dan,

    Thanks for the reply - I have the following in my JS which seems to be defining the function

     function callFlashPlayPauseVideo(number)

    However, I notice I'm adding in an unecessary parameter - but even when I remove this parameter - the problem still exists.

    As for the jquery - I'm not really any good with jquery I just have it added for my gallery etc so I was sticking to what I know using the body onload.

    Cheers, Garry.

  • dandrayne 1138 posts 2262 karma points
    Jan 11, 2010 @ 15:39
    dandrayne
    0

    What I think _might_ be happening is that the function is being called too quick, although I haven't been able to spend a great deal of time investigating.

    If this is the case, you could quickly check by removing the body onload and putting the video calls into the document ready e.g.

    <script type="text/javascript">
    $(function()
    {
    $('a[@rel*=lightbox]').lightBox();
    });
    </script>
    <body onload="bleh();">

    becomes

    <script type="text/javascript">
    $(function()
    {
    $('a[@rel*=lightbox]').lightBox();
    initialize();
    callFlashPlayVideo();
    });
    </script>
    <body onload();>

    Might be worth a shot!

    Dan

  • dandrayne 1138 posts 2262 karma points
    Jan 11, 2010 @ 15:40
    dandrayne
    0

    2nd example should just have

    <body>

    Dan

  • Garry Bain 149 posts 124 karma points
    Jan 11, 2010 @ 16:10
    Garry Bain
    0

    Nope, won't even load the functions using the jquery method, I'm afraid. Thanks anyway. The code works fine when the JS in inside its own .js file and not the XSLT - it's just when the page initially loads - it states that the main variable doesn't exist. I'm wondering what the different is between a page loading an a refresh. Maybe something to do with the variable being in scope?

Please Sign in or register to post replies

Write your reply to:

Draft