Adicionar Flowplayer desde Drupal module custom
En un mòdulo, node.tpl, previamente se hizo una funciòn que se encargara de reproducir el video con ciertos parametros como: tamaño video, imagen preview, entre otras caracteristicas:
al momento de llamar la funciòn tenemos los siguientes paràmetros:
Fuentes de ayuda:
https://drupal.org/node/1210404 , multiples videos, se debe poner una clase o id diferente
https://drupal.org/node/1175080, propiedades del plugin
http://api.drupalhelp.net/api/flowplayer/flowplayer.module/function/flowplayer_help/7, codigo de la Api
https://drupal.org/node/816532, imagen preview, spash
v: url completa del video
$i: url completa de la imagen
$id: lo tengo como un array que reune cietos datos:
array(0=>id del nodo, 1=> ancho, 2 => alto )
1. Instalar modulo de flowplayer para drupal 7
2. Crear la siguiente funciòn en cualquier modulo:
function getVideo($v, $i, $id) {
$output = "";
if (!empty($v)):
$options = array(
'playlist' => array(
array(
'url' => $i, //Url imagen
),
array(
'url' => $v,
'autoPlay' => false,
'autoBuffering' =>false, //Debe estar en false para que muestre la imagen preview
),
),
);
$output .= theme('flowplayer', array('id' => "flowplayer-$id[0]", 'config' => $options, 'attributes' => array('class'=>"flowplayer-$id[0]", 'style' => "width:$id[1]px;height:$id[2]px;", "wmode" => 'opaque')));
else:
//$output = t("No existe video");
endif;
return $output;
al momento de llamar la funciòn tenemos los siguientes paràmetros:
Fuentes de ayuda:
https://drupal.org/node/1210404 , multiples videos, se debe poner una clase o id diferente
https://drupal.org/node/1175080, propiedades del plugin
http://api.drupalhelp.net/api/flowplayer/flowplayer.module/function/flowplayer_help/7, codigo de la Api
https://drupal.org/node/816532, imagen preview, spash
v: url completa del video
$i: url completa de la imagen
$id: lo tengo como un array que reune cietos datos:
array(0=>id del nodo, 1=> ancho, 2 => alto )
1. Instalar modulo de flowplayer para drupal 7
2. Crear la siguiente funciòn en cualquier modulo:
function getVideo($v, $i, $id) {
$output = "";
if (!empty($v)):
$options = array(
'playlist' => array(
array(
'url' => $i, //Url imagen
),
array(
'url' => $v,
'autoPlay' => false,
'autoBuffering' =>false, //Debe estar en false para que muestre la imagen preview
),
),
);
$output .= theme('flowplayer', array('id' => "flowplayer-$id[0]", 'config' => $options, 'attributes' => array('class'=>"flowplayer-$id[0]", 'style' => "width:$id[1]px;height:$id[2]px;", "wmode" => 'opaque')));
else:
//$output = t("No existe video");
endif;
return $output;

Comentarios
Publicar un comentario