Como embeber un video subido desde archivo ?

15 Oct '15, 09:00 AM
35,106 Views
No Forum Badges

Hola, quisiera poder subir un video desde un archivo y poder reproducirlo. Actualmente en Webratio store hay dos componentes para video pero no son compatibles con la version. Existe alguna forma de lograrlo? 

Desde ya muchas gracias. 

Saludos.

 
x 0
Follow
Answer Answer at this question and get points!
Forum Starter - Level 2

Yo te recomendaría que copies el contenido del archivo Normal.unit.template del componente Details del proyecto de estilo WRDefault.

El que has copiado es específico para una unidad que tenga 3 atributos en el display attributes, el primero title, el segundo descr y el tercero image.

El que te digo del componente Details es más general y tiene la etiqueta <wr:Value/> que te mencioné.

También te recomiendo que cuando empieces a tocar estilos borres todo lo que no entiendas y conforme vayas necesitando código lo vayas añadiendo.

Para mostrar el vídeo lo que haría falta sería algo como esto:

 

#?delimiters [%, %], [%=, %]

[% setHTMLOutput() %]

<c:if test="${not(empty <wr:Id context="unit"/>) and (<wr:Id context="unit"/>.dataSize gt 0)}">

<wr:Frame>

    <div class="video <wr:StyleClass/>">
        <wr:Iterate var="attr" context="unit" select="layout:Attribute">
            <wr:Visible>
                  <video width="320" height="240" controls>
                  <source src="<wr:Value/>" type="video/mp4">
                  Your browser does not support the video tag.
                </video>
            </wr:Visible>
        </wr:Iterate>
    </div>

</wr:Frame>
</c:if>

No lo he probado, pero no debería hacer falta mucho más :)

 

Espero que te sirva

 

 
x 0
No Forum Badges

Hola, eh estado viendo como hacer lo del video. Me fui a archivo, cree un nuevo layout tamplate basado en  details. Y le puse el nombre video saliendome el nombre completo video.unit.template. Arriba de este archivo tengo otro que dice ImageDescription.unit.template. Copie todo el contenido de ese archivo al archivo video.unit.template. El cual seria este.

 

#?delimiters [%, %], [%=, %]
<wr:LayoutParameter name="bar-position" label="Bar position" type="enum" default="top" values="top|bottom">
Defines the rendition of the description bar.
Allowed values are:
- top : places the bar on the top
- bottom (default): places the bar on the bottom
</wr:LayoutParameter>

<wr:RequireResource ref="ImageDescription-style" />
<wr:RequireResource ref="ImageDescription-script" />

[%
setHTMLOutput()
import org.apache.commons.lang.StringUtils

def title = unit.selectSingleNode("layout:Attribute[1]")
def descr = unit.selectSingleNode("layout:Attribute[2]")
def image = unit.selectSingleNode("layout:Attribute[3]")
def barPosition = StringUtils.capitalize(params["bar-position"])
    
%]

<c:if test="${not(empty <wr:UnitId/>) and (<wr:UnitId/>.dataSize gt 0)}">
<div class="plain <wr:StyleClass/>">
    <div id="<wr:UnitId/>" class="plain ImageDescriptionDataUnit">
        <img src="<webratio:BLOB value="${<wr:UnitId/>.data.[%=getFieldName(image)%]}"/>" alt="<c:out value="${<wr:UnitId/>.data.[%=getFieldName(image)%].name}"/>" title="<c:out value="${<wr:UnitId/>.data.[%=getFieldName(image)%].name}"/>" />
        <div class="ImageDescriptionDataUnitOverlay ImageDescriptionDataUnit[%= barPosition %]">
            <div class="ImageDescriptionDataUnitTitle">
                <a href="#" class="ImageDescriptionDataUnitClose" onclick="ImageDescriptionToggle('<wr:UnitId/>');return false;">${<wr:UnitId/>.data.[%=getFieldName(title)%]} (read more)</a>
            </div>
            <div class="ImageDescriptionDataUnitDescr" style="display:none;">
                <div>${<wr:UnitId/>.data.[%=getFieldName(descr)%]}</div>
            </div>
            <div class="ImageDescriptionDataUnitBg"></div>
        </div>
    </div>
</div>
</c:if>  

El problema es que nose donde pondria el codigo que sugeriste. Se que podria ir en el src pero no encuentro la etiqueta <wr:Value/>

 

Desde ya muchas gracias.

Saludos.

 
x 0
Forum Starter - Level 2

Hola cyber,

Yo lo haría con un Details Unit. 

Pones como display attributes el atributo de tipo blob donde guardas el archivo (que normalmente es una ruta al archivo)

Y después creas un Unit Template para la Details Unit, copiando el archivo Normal.unit.template de este componente y renombrándolo.

Sólo queda cambiar la parte donde se muestra el valor del atributo, que es donde pone <wr:Value/>

que sería algo así para un vídeo mp4

<video width="320" height="240" controls>
  <source src="<wr:Value/>" type="video/mp4">
  Your browser does not support the video tag.
</video>

Los estilos es la parte más engorrosa de WebRatio, pero si te haces a ellos hace la herramienta mucho más versátil :)

 
x 0
Answer at this question and get points!

Related questions

2 grids inside one/same cell result in non-selectable 2nd grid Access page variable in a page template add html Ajax is not working in own style project Ajax web app with javascript history object using the WebRatio Alimentar graficas con base de datos Alternate way to get current User Oid in layout template groovy script? Any way to localize the Tab Grid Template (Webratio Store)? Applicare un template ad un Web Project Ayuda Simple List Component Layout personalizado Bootstrap Style Button to go on another page Cambiare dimensioni bottoni - Change button size Can I inject html into custom unit template?! Change color template bootstrap style Change Style Changing the login page does not work ckeditor - change directory for the browser Colore Attributi index unit Dinamico - Index unit dynamic attribute color Como abrir una ventana en ajax desde una master page Como mostrar una imagen de portada arriba del menu? Como mostrar una imagen en una lista o en la componente detalles? Confirm Dialog Customize layout mobile platform Custom Tooltip Position Default error pages default login page Display contents of a URL Dynamic link labelling for Custom Unit Error in Excel Unit - Font size Export to a HTML/CSS/JS project Field as link soruce File CSS non considerato in generazione Form element Form template Get date pattern Get home page from template Google map is not shown properly in the tab grid Guardar Saltos de LINEA HelloWorld Unit sample code Hiding landmarks (or flows) when the user is logged in How can i create pagemenu or landmarkmenu with multiple levels. How can I modified the htmls files to perform my style How to add an image in a modal/pop-up window? How to include a template into other template? How to localize AJAX waiting dialog? How to localize the multi message unit in the notification layout How to modify template? How to modify the FertileEnviroment Default page How to remove default Linked Resources? How to use LandmarkMenu as AJAX navigation how to use the landmark menu as AJAX navigation integrate framework to webratio mobile Integrazione javascript Javascript and html javascript history object Localize "Welcome..." and "Process details" logo webratio meaning of each tag in the XML code (Show XML/Show Layout XML) modify field html Modify html generated by wr:NavigationBar Pages Problem After Project Generation pass template variable Problem Login Form only if user not logged Problem print Problems with the page refresh (Tab Grid) Problem with adding templates query unit who to hide fields that are used in a link Recursive Hierarchical Index Unit Style Tree Redirect to the default module Remove default BPM css import for all templates Responsive Bootstrap Grid Responsive Layout Manager Set context parameter Simple Static Page Standard confirm dialog replacement Style hierarchical unit help!! Supoort for Mobile and Desktop display Target tabs in Tab Grid Control Tooltip on a field Too much layout parameters = no scroll in parameters config window Uppercase Use image as interaction flow Vista de diferentes Site Views Webratio Add-ons no permite login wr-ajaxDivs break layout on ajax pages.