Hi.
I need to create a macro to display a video or image in a video player.
Having the following code.
## @param tipe:title=Tipo de recurso|type=enum|enumValues=Imagen,Vídeo|required=true|default=none|desc=Elige un tipo (requerido)
## @param image:title=URL de la imagen|type=string|required=false|desc=Introduce la URL de la imagen (requerido)
## @param video:title=URL del vídeo|type=string|required=false|desc=Introduce la URL del vídeo (requerido en caso de vídeo)
## @param width:title=Width|type=string|required=false|default=45%|desc=Ancho (es recomendable dejar como está y solo ajustar si es necesario)
#set ($attachment = $content.getAttachmentNamed($paramvideo))
#if ($paramtipe && $paramtipe=="Imagen")
<img style="margin:0px auto !important; display:block;" class="teaser"
#if ($paramimage && $paramimage.length()>0) src="$paramimage" #end
#if ($paramwidth && $paramwidth.length()>0) width="$paramwidth" #end
>
#end
#if ($paramtipe && $paramtipe=="Vídeo")
<div style="margin:0px auto !important; display:block; text-align:center !important;">
<video style="margin:0px auto !important; display:block; text-align:center !important;" controls
#if ($paramimage && $paramimage.length()>0) src="$paramvideo" poster="$paramimage" #end
#if ($paramwidth && $paramwidth.length()>0) width="$paramwidth" #end
>
<img style="margin:0px auto !important; display:block;" class="teaser" width="$paramwidth" src="$paramimage">
Si tienes problemas para visualizar el vídeo, haz clic <a target="_blank" href="$paramvideo">aquí</a>.</p>
</video>
</div>
#end
Can I use something similar to the next param to replace the url field for an upload selection?
@param file:title=File|type=Allow Upload|required=false|desc=Select a video do use
Regards
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.