﻿ $.fn.media.defaults.mp3Player = $webRoot + "/scripts/niftyplayer.swf";
 $.fn.media.defaults.flvPlayer = $webRoot + "/scripts/player_flv.swf";
 
function SetMp3Player(url, id) {
    var player = $webRoot + "/scripts/niftyplayer.swf";
    var script = '<object type="application/x-shockwave-flash" data="' + player + '?file=' + url + '" width="165" height="37" wmode="transparent">';
    script += '<param name="movie" value="' + player + '" />';
    script += '<param name=quality value=high>';
    script += '<param name=bgcolor value=#FFFFFF>';
    script += '<param name="FlashVars" value="file=' + url + '" />';
    script += '</object>';
    $('#' + id).html(script);
    //$('#' + id).media({ width: 165, height: 37, autoplay: false, bgColor: '#FFFFFF', flashvars: {file: url}});
}
function Play_flv(url, startImg, w, h) {
    if (!w) w = 320;
    if (!h) h = 240;
    var player = $webRoot + "/scripts/player_flv.swf";
    var startImage = '';
    if (startImg) startImage = "&amp;startimage="+startImg;

    var script = '<object id="_flashPlayer" type="application/x-shockwave-flash" data="' + player + '" width="' + w +'" height="' + h +'" wmode="transparent">';
    script += '<param name="movie" value="' + player + '" />';
    script += '<param name="wmode" value="transparent">';
    script += '<param name="FlashVars" value="flv=' + url + startImage + '&amp;width=' + w +'&amp;height=' + h +'&amp;playercolor=808094&amp;bgcolor1=9293a9&amp;bgcolor2=808094&amp;buttoncolor=dddddd&amp;buttonovercolor=f9bf37&amp;slidercolor1=dddddd&amp;slidercolor2=cccccc&amp;sliderovercolor=f9bf37&amp;loadingcolor=ffff00&amp;showstop=1&amp;showvolume=1&amp;showtime=1" />';
    $('#mediaEmbeded').html(script);
}
function Play_swf(url, w, h) {
    if (!w) w = 320;
    if (!h) h = 240;
    $("#MediaUrl").attr("href", url);
    $('#MediaUrl').media( { width: w, height: h, autoplay: false } ); 
}
function Play_wmv(url, startImg, w, h) {
    if (!w) w = 320;
    if (!h) h = 240;
    $("#MediaUrl").attr("href", url);
    $('#MediaUrl').media( { width: w, height: h, autoplay: false } ); 
}
function Play_wav(url, startImg) {
    $("#MediaUrl").attr("href", url);
    $('#MediaUrl').media( { width: 320, height: 240, autoplay: false } ); 
}
function Play_swf2(url, startImg, w, h) {
    $('#mediaEmbeded').show();
    if (!w) w = 320;
    if (!h) h = 240;
    var script = '<object width="' + w +'" height="' + h +'"  classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" wmode="transparent">';
    script += '<param name=movie value="' + url + '">';
    script += '<param name=quality value=high>';
    script += '<embed src="' + url + '" quality=high bgcolor=#FFFFFF width="' + w +'" height="' + h +'" name="niftyPlayer1" type="application/x-shockwave-flash" swLiveConnect="true" pluginspage="http://www.macromedia.com/go/getflashplayer" wmode="transparent"></embed>';
    script += '</object>';
    $('#mediaEmbeded').html(script);
}

