Order Now AdSolution Sign Up | Login » Bits on the Run Sign Up | Login »

Forums

/

loadFile with recommendations

5 replies [Last post]

Sorry, but I haven't found any solution here, and I can't get to work what I need. So, I've finally decided to ask. :)

What I'm trying to achived is this:
- have recommendations
- when clicking on a recommended thumbnail, load the player with the video

So far, all I've come up to is an error message when clicking on a link: "thisMovie("mpl") has no properties"

Here is my js:

function thisMovie(movieName) {
if(navigator.appName.indexOf("Microsoft") != -1) {
return window[movieName];
} else {
return document[movieName];
}
};

function loadRecommendation(rAuthor, rTitle, rFile) {
loadFile({author:rAuthor, title:rTitle, file:rFile});
};

function loadFile(obj) {
thisMovie('mpl').loadFile(obj);
};

The xml file is so:

<recommendations>
<recommendation>
<title>Proud Mary</title>
<link><![CDATA[javascript:loadRecommendation("Ike &amp; Tina Turner","Proud Mary","http://localhost/testiso/wordtube/wp-content/uploads/ike-tina-turner-proud-mary.mp3");]]></link>
<image>http://localhost/testiso/wordtube/wp-content/uploads/Variationsuruntheme.jpg</image>
</recommendation>
</recommendations>

And the player:

<div class="wordtube single8" id="WT161"><a href="http://www.macromedia.com/go/getflashplayer">Get the Flash Player</a> to see the wordTube Media Player.</div>
<script type="text/javascript" defer="defer">
var so = new SWFObject("http://localhost/testiso/wordtube/wp-content/plugins/wordtube/mediaplayer.swf", "8", "320", "240", "7", "#FFFFFF");
so.addVariable("file", "http%3A%2F%2Flocalhost%2Ftestiso%2Fwordtube%2Fwp-content%2Fuploads%2Fbangbang.flv");
so.addVariable("image", "http://localhost/testiso/wordtube/wp-content/uploads/chain.jpg");
so.addVariable("id", "8");
so.addVariable("width", "320");
so.addVariable("height", "240");
so.addVariable("overstretch", "false");
so.addVariable("showdigits", "true");
so.addVariable("showfsbutton", "true");
so.addVariable("backcolor", "0xFFFFFF");
so.addVariable("frontcolor", "0x000000");
so.addVariable("lightcolor", "0x000000");
so.addVariable("volume", "80");
so.addVariable("bufferlength", "5");
so.addVariable("fullscreenpage", "http://localhost/testiso/wordtube/wp-content/plugins/wordtube/fullscreen.html");
so.addVariable("fsreturnpage", "http://localhost/testiso/wordtube/?p=13");
so.addParam("allowfullscreen", "true");
so.addVariable("enablejs", "true");
so.addVariable("javascriptid", "mpl");
so.addVariable("recommendations", "http://localhost/testiso/wordtube/wp-content/plugins/wordtube/myrelatedXML.php?id=8");
so.write("WT161");
</script>

What am I doing wrong?

Here a live example of it: http://www.alakhnor.com/ptalbum/?p=654

change the "8" to "mpl" (the name of the player must match the javascriptid).var so = new SWFObject("http://localhost/testiso/wordtube/wp-content/plugins/wordtube/mediaplayer.swf", <strong>"mpl"</strong>, "320", "240", "7", "#FFFFFF");This is only used for RTMP streaming, so lose it:so.addVariable("id", "8");

Awesome!

Thanks a lot. :)

Some other questions:

- is there a way to get the recommended thumbnail above the control bar? This is when controls are not shown.
- is there a way to call statistics for the recommended media when they are played from there?

Thumbnails can't be re-positioned, unless of course, you want to edit the ActionScript and re-compile.

The statistics callback reports whatever is playing, so it should report the recommendations also.

Is there some place I can see a tutorial on how to do this?
I looked at your demo and it seems you've been successful at getting the recommendations on top of the video.
I would love to do this.