body onload

rmsmi
rmsmi Community Member Posts: 8
Does anyone know of anywhere in Lectora to insert a body onload command? Here is the text:





I'm trying to put a custom video player via swfobject together within HTML Object but it doesn't want to load.

Comments

  • ssneg
    ssneg Community Member Posts: 1,466 ☆ Roadie ☆
    1. Add an action in Lectora: "On Page Show -> Run JavaScript"

    2. Enter createVideoPlayer('video') as the command to run



    Your command will run as soon as Lectora renders the page.
  • rmsmi
    rmsmi Community Member Posts: 8
    @ssneg 61947 wrote:
    1. Add an action in Lectora: "On Page Show -> Run JavaScript"

    2. Enter createVideoPlayer('video') as the command to run



    Your command will run as soon as Lectora renders the page.


    Thanks for your help.



    For some reason it still won't load. I've got all the media/image files loaded in the html object but it still shows as a black box on the html rendered page.



    Can anyone pinpoint something wrong in the code I've used (for Workshop Player):

















    function createVideoPlayer(id)

    {

    toggleTranscript();



    var playerwidth = 600;

    var playerheight = 337;

    var params = {};

    params.bgColor = "#000000";

    params.allowFullScreen = true;



    var flashvars = {};

    flashvars.id = id;

    flashvars.mediaURL = "dummy_video.flv";

    flashvars.imageURL = "dummy_still.jpg";

    flashvars.captionsURL = "dummy_captions.xml";

    flashvars.audioDescriptionURL = "dummy_audiodesc.mp3";

    flashvars.language = "en/";

    swfobject.embedSWF("videoplayer.swf",id, playerwidth , playerheight, "10.1", null, flashvars, params);



    }

  • ssneg
    ssneg Community Member Posts: 1,466 ☆ Roadie ☆
    If you see a black rectangle, then probably your swf has loaded and cannot find the movie. Make sure that it is available.

    1. Look in the publish folder. Is it there? Is it located where it should be?

    2. In browser, see error console. Any errors? Any network requests to files that couldn't be found?
Sign In or Register to comment.

So You Wanna Be An eLearning ROCKSTAR?

We're all fans of eLearning here! Want to become an eLearning ROCKSTAR? Just click on one of the buttons below to start your rocking journey!