Re: [solved] FLVPlayer with last version of JW (3.9)
Posted: Wed Jan 02, 2008 4:15 pm
Here are the minimal templates I'm using :
Summary :
Detail :
I'm not using the list template...
The code I'm inserting into the video page :
Note that I'm using a table to separate the video player from the video summary...
Hope this will help...
Keep in touch !
Summary :
Code: Select all
{literal}
<__script__ type="text/javascript">
function loadFile(obj) { thisMovie("mpl").loadFile(obj); };
// This is a javascript handler for the player and is always needed.
function thisMovie(movieName) {
if(navigator.appName.indexOf("Microsoft") != -1) {
return window[movieName];
} else {
return document[movieName];
}
};
function newMovie(urlbase,name,movie_id,movie_title,description,created,modified,start_date,end_date,genre,member,length,directurl) {
movie_url = urlbase+'/'+name+'.flv';
image_url = urlbase+'/'+name+'.jpg';
loadFile({file:movie_url,title:movie_title,link:movie_url,id:movie_id,image:image_url,author:member});
};
</__script>
{/literal}
<div class="showSummary">
{foreach from=$summaryitems item=entry}
<p class="showValue"><a href="javascript:newMovie('{$flvurlprefix}','{$entry->name}',{$entry->id},'{$entry->slash_title}','{$entry->slash_description}','{$entry->created|date_format}','{$entry->modified|date_format}','{$entry->start_date|date_format}','{$entry->end_date|date_format}','{$entry->genre}','{$entry->member}','{$entry->length_hours}:{$entry->length_minutes}:{$entry->length_seconds}','{$entry->url}')">
{$entry->slash_title}</a></p>
<p>{$entry->slash_description}</br>
Durée : {$entry->length_hours}:{$entry->length_minutes}:{$entry->length_seconds}</p>
{/foreach}
</div>
Code: Select all
<__script__ type="text/javascript" src="{$flvplayerlocation}/swfobject.js"></__script>
<div id="player">
<a href="http://www.macromedia.com/go/getflashplayer">Get the Flash Player</a>to see this movie.
</div>
{literal}
<__script__ type="text/javascript">
var so = new SWFObject('{/literal}{$flvplayerlocation}{literal}/mediaplayer.swf','mpl','320','240','7');
so.addParam('allowfullscreen','true');
so.addVariable('displayheight','240');
so.addVariable('file','{/literal}{$flvurlprefix}/{$field_name}.flv{literal}');
so.addVariable('height','240');
so.addVariable('image','{/literal}{$flvurlprefix}/{$field_name}.jpg{literal}');
so.addVariable('width','320');
so.addVariable('autostart','false');
so.addVariable('overstretch','false');
so.addVariable('showvolume','true');
so.addVariable('enablejs','true');
so.addVariable('logo','{/literal}{$flvplayerlocation}{literal}/flv_logo.png');
// Very important to use the js loadFile() and sendEvent() funtions
so.addVariable('javascriptid','mpl');
so.addVariable('type','flv');
so.write('player');
</__script>
{/literal}
The code I'm inserting into the video page :
Note that I'm using a table to separate the video player from the video summary...
Code: Select all
<table><tbody>
<tr>
<td>{cms_module module='FLVPlayer' mode='detail'}</td>
<td>{cms_module module='FLVPlayer' mode='summary' sort='created_asc'}</td>
</tr>
</tbody></table>
Keep in touch !