Displaying Media
From KickApps Documentation
To display media, the sample application takes the payload, creates a client-side plug in for the Flash player, and then finds the correct player based on the media type.
C# Example
var kaplayer=document.getElementById('ka_playPagePlayer');
var embed1=document.createElement('embed');
embed1.id='ka_player';
Next, the application checks for the correct version of the Flash player. If the media type returned in the payload is video, the video player is used, if audio then the audio player is used, and if the media type is neither video or audio then the photo version of the Flash player is used.
if(this.type=='VIDEO' || this.type=='video'){
kaplayer.innerHTML = '<embed width="370" height="280" type="application/x-shockwave-flash" '+'src="'+'<%= clsRestClient.getServerURI(Request) %>/sampleApp/flash/smdkPlayer.swf?p=<%= clsRestClient.CDN_BASE_URI %>'+obj.media.pathToMedia+'"/>';
}
else if(this.type=='AUDIO' || this.type=='audio'){
kaplayer.innerHTML = '<embed width="370" height="280" type="application/x-shockwave-flash" '+'src="'+'<%= clsRestClient.getServerURI(Request) %>/sampleApp/flash/smdkAudio.swf?p=<%= clsRestClient.CDN_BASE_URI %>'+obj.media.pathToMedia+'"/>';
}
else {
kaplayer.innerHTML = '<embed width="370" height="280" type="application/x-shockwave-flash" '+'src="'+'<%= clsRestClient.getServerURI(Request) %>/sampleApp/flash/smdkPhoto.swf?p=<%= clsRestClient.IMAGES_BASE_URI %>'+'kickapps/images/'+obj.media.pathToMedia+'"/>';
}
Displaying Media in a Custom Flash Player
If you want to use your own players, simply include a parameter to the player with the full path to the media. As with the other API calls, this is made up of a Base URL and the path to the media item to display.
C# Example
<%= clsRestClient.CDN_BASE_URI %>'+obj.media.pathToMedia+'"/>
In the sample applications, the parameter is stated as follows:
- p. The full path to the media. As with the other API calls, this is made up of a Base URL and the path to the media item to display.
p=<%= clsRestClient.CDN_BASE_URI %>'+obj.media.pathToMedia+'"/>
Favorites






