KDP Download Button Flavor

1 reply [Last post]
Wed, 09/08/2010 - 13:52
Joined: 07/27/2010
Points: 7

Hi,
The download button always downloads the (basic - small) flavor of the video....
How can I set it to download another flavor (I'd like the source flavor instead).

Thanks
Regards,

Download dialog
Joined: 01/05/2009
Points: 1697

Hi,

Unfortunately there is no easy way of doing this at the moment, as the download button just downloads whatever is currently being played (or defined in the flavorId flashvar).
You can't set the download button to a different url or flavor.

If you are a flash person, there is an easy way to this, download the source for the download plugin:
http://www.kaltura.org/kalorg/kdp/trunk/plugins/downloadPlugin/
Then Edit the mediator file:
http://www.kaltura.org/kalorg/kdp/trunk/plugins/downloadPlugin/src/com/k...
In the handleNotification function, try to check for a new flashVar (e.g. downloadFlavorId) and then change the urls to use this.

e.g.
Change the following code to the code after.

var mediaProxy : Object = facade.retrieveProxy("mediaProxy");
var entry:String=mediaProxy.vo.entry.id;
_flashvars= facade.retrieveProxy("configProxy")["vo"].flashvars;
var cdnHost:String= _flashvars.cdnHost;
var partner:String= _flashvars.partnerId;
var subPartner:String= _flashvars.subpId;
var flavor:String= _flashvars.flavorId;
var url:String;
if (flavor !=null){
  url="http://"+cdnHost+"/p/"+partner+"/sp/"+subPartner+"/download/entry_id/"+entry+"/flavor/"+flavor;         
}
else
{
  url="http://"+cdnHost+"/p/"+partner+"/sp/"+subPartner+"/download/entry_id/"+entry
}      
var request:URLRequest= new URLRequest(url);
navigateToURL(request, "_blank");

to -

var mediaProxy : Object = facade.retrieveProxy("mediaProxy");
var entry:String=mediaProxy.vo.entry.id;
_flashvars= facade.retrieveProxy("configProxy")["vo"].flashvars;
var cdnHost:String= _flashvars.cdnHost;
var partner:String= _flashvars.partnerId;
var subPartner:String= _flashvars.subpId;
var flavor:String= _flashvars.flavorId;
var downloadFlavorId:String= _flashvars.downloadFlavorId;
var url:String;
if (downloadFlavorId != null) {
        url="http://"+cdnHost+"/p/"+partner+"/sp/"+subPartner+"/download/entry_id/"+entry+"/flavor/"+downloadFlavorId;
} else {
        if (flavor !=null){
          url="http://"+cdnHost+"/p/"+partner+"/sp/"+subPartner+"/download/entry_id/"+entry+"/flavor/"+flavor;         
        }
        else
        {
          url="http://"+cdnHost+"/p/"+partner+"/sp/"+subPartner+"/download/entry_id/"+entry
        }
}
var request:URLRequest= new URLRequest(url);
navigateToURL(request, "_blank");

Then go to your KMC, click the name of the video, go to the flavors tab, copy the "asset_id" of the flavor you'd like the download button to use, edit the embed code of your player and add the following to the player flashVars:
downloadFlavorId=[asset_id] (e.g. - downloadFlavorId=1_iweyrtwuie)