Jump to content

Hard For Me - Simple For You - PLEASE HELP!!

- - - - -

This topic has been archived. This means that you cannot reply to this topic.
2 replies to this topic

#1
Algie

Algie

    Newbie

  • Members
  • Pip
  • 2 posts
Ok, all you php experts. I'm sure this is gonna be a breeze for you. Me? I'm COMPLETELY stuck.

I'm trying to build a page that has a video player in a table.
I also have 3 buttons in that table that are supposed to make 3 different videos play in that same player, depending on which button you click.

I cannot figure out how to program the buttons to make the different videos play.
The co-worker that's supposed to be "helping"with project won't tell me how to do it. He keeps wanting me to figure it out by myself. But, I do not know php, so I'm not versed in the language and I'm not able to figure it out.

These two sections of code exist on the page in the header. This "helpful" co-worker says all the elements I need are right there:

<?php
$url1 = "M1010eBwvCddHimDExsiI";
$url2 = "M1010rBwvCddDweeuzEml";
$url3 = "M1010aBwvCddljtfpdqjn";
$url4 = "M1010zBwvCddvICqpwmeo";
$url5 = "M1010vBwvCddcGuEmlBDy";
$url6 = "M1010ABwvCddovuidHjuf";
$url7 = "M1010vBwvCddcGuEmlBDy";
if( $_GET['video'] > 0  && $_GET['video'] < 8 ) {
    $holder = "url" . $_GET['video'];
    $startURL = $$holder;
} else {
    $startURL = $url7;
}
?>

 <script type='text/javascript'>
        var player;
        Vusion.components.on({componentAdded: vusionComponentAdded, scope: this});

        function vusionComponentAdded(event) {
                player = Vusion.components.get(event.id);
        }

        function switchVideo(slideNum)
        {
            toggleSlides(slideNum);
            if(slideNum == "slide5") {
                player.setProperty("url", "vusion://<?php echo $url5; ?>.vusion");
            } else if(slideNum == "slide2") {
                player.setProperty("url", "vusion://<?php echo $url2; ?>.vusion");
            } else if(slideNum == "slide3") {
                player.setProperty("url", "vusion://<?php echo $url3; ?>.vusion");
            } else if(slideNum == "slide4") {
                player.setProperty("url", "vusion://<?php echo $url4; ?>.vusion");
            } else if(slideNum == "slide1") {
                player.setProperty("url", "vusion://<?php echo $url1; ?>.vusion");
            } else if(slideNum == "slide6") {
                player.setProperty("url", "vusion://<?php echo $url6; ?>.vusion");
            } else {
                player.setProperty("url", "vusion://<?php echo $url7; ?>.vusion");
            }
        }
    </script>   

So, here are my 3 buttons (for slide 7, 6 and 2) . This is all I could muster and it doesn't work:

<a href="#" onclick="switchVideo("slide7")" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('killers','','/vusion/images/butt-video-killers-on.jpg',1)"><img src="/vusion/images/butt-video-killers.jpg" name="killers" width="298" height="57" border="0" id="killers" /></a>

        <a href="#" onclick="switchVideo("slide6")" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('Hannibal','','/vusion/images/butt-video-hannibal-on.jpg',1)"><img src="/vusion/images/butt-video-hannibal.jpg" name="Hannibal" width="298" height="53" border="0" id="Hannibal" /></a>

        <a href="#" onclick="switchVideo("slide2")" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('Hummingbird','','/vusion/images/butt-video-hummingbird-on.jpg',1)"><img src="/vusion/images/butt-video-hummingbird.jpg" name="Hummingbird" width="298" height="57" border="0" id="Hummingbird" /></a>

I don't even know if I'm on the right track. I think all I need is the right code inside the <a href> tag. The "helpful" dude said the URL is right there! Sorry, but "vusion://<?php echo $url5; ?>.vusion" just doesn't look like a url to me. It's like a php url or something.

This is the page in question:

VUSION

I would SO appreciate any help on this.
Thank you SO much!
Algie

Edited by Alexander, 17 December 2010 - 09:15 PM.
([code] and [php] tags where needed)


#2
Alexander

Alexander

    It's Science!

  • Moderators
  • 4,124 posts
Your HTML syntax is incorrect, for example

Quote

onclick="switchVideo("slide7")"
will break, escapes should be added:
onclick="switchVideo(\"slide7\")"
vusion:// appears to be a custom stream wrapper, and I can without a doubt signify it to the browser plugin that is required to be installed before viewing the vusion player, it is likely meant to work together.

You should check the documentation of the browser plugin and stream wrapper or Javascript interface to debug further, I do not have the documentation.
Be sure to read the updated FAQ! || Health is achieved through the same 10,000 steps.
If a suggested code/method fails, informing us is less important than telling us why or what errors occurred.

#3
Algie

Algie

    Newbie

  • Members
  • Pip
  • 2 posts
Nullw0rm, thank you so much for offering that solution. I tried it, but unfortunately it didn't work. You can see backward slashes in the code if you look at the source. I left them in. Let me know if I didn't do it right, k?
Any other ideas??

Oh, I should probably show you this. This whole idea works on this page:

VUSION FullVu Player

I pulled the code off of this page:

Vusion

We're getting rid of the swfObject and going with the buttons. And thus is my dilemma. If I could see the flash piece that created the swfObject maybe I could see how the urls are named for the different vidoes. But, the flash file isn't available to me.

Thanks again for your help!