function osmplayer_get_player in MediaFront 6.2
Same name and namespace in other branches
- 6 players/osmplayer/osmplayer.module \osmplayer_get_player()
- 7.2 players/osmplayer/osmplayer.module \osmplayer_get_player()
- 7 players/osmplayer/osmplayer.module \osmplayer_get_player()
Implementation of hook_get_player()
File
- players/
osmplayer/ osmplayer.module, line 9
Code
function osmplayer_get_player($params) {
$template = isset($params['template']) && $params['template'] ? $params['template'] : "default";
$showPlayer = isset($params['showWhenEmpty']) ? $params['showWhenEmpty'] : TRUE;
// If they provide the playlist object, encode it as JSON.
if (isset($params['playlistObj']) && $params['playlistObj']) {
$showPlayer |= $params['playlistObj']['total_rows'] > 0;
$params['playlist'] = mediafront_json_encode($params['playlistObj']);
}
else {
$showPlayer |= isset($params['playlist']) && $params['playlist'];
}
// If they provide the node object, encode it as JSON.
if (isset($params['nodeObj']) && $params['nodeObj']) {
$showPlayer |= isset($params['nodeObj']['mediafiles']) && count($params['nodeObj']['mediafiles']) > 0;
$params['node'] = mediafront_json_encode($params['nodeObj']);
}
else {
$showPlayer |= isset($params['node']) && $params['node'];
}
// Show the player.
return $showPlayer ? theme('osmplayer_' . $template, $params) : '';
}