30.07.2013 Views

Componente del reproductor de YouTube. .Guía de ... - Google

Componente del reproductor de YouTube. .Guía de ... - Google

Componente del reproductor de YouTube. .Guía de ... - Google

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

El componente <strong><strong>de</strong>l</strong> <strong>reproductor</strong> <strong>de</strong> <strong>YouTube</strong> también cuenta con tres métodos estáticos a los que se pue<strong>de</strong> llamar<br />

en cualquier momento, incluso sin tener que crear o inicializar el objeto <strong><strong>de</strong>l</strong> <strong>reproductor</strong> <strong>de</strong> <strong>YouTube</strong>. Debido a esto,<br />

se <strong>de</strong>bería llamar a las funciones a través <strong>de</strong> YTPlayer en lugar <strong><strong>de</strong>l</strong> proxy. A continuación, se muestran estos<br />

métodos y un ejemplo <strong>de</strong> cómo usarlos y llamarlos.<br />

>. pauseAllVi<strong>de</strong>os():void: <strong>de</strong>tiene todos los ví<strong>de</strong>os que se estén reproduciendo actualmente.<br />

>. muteAllVi<strong>de</strong>os():void: silencia todos los ví<strong>de</strong>os que se estén reproduciendo actualmente.<br />

>. <strong>de</strong>stroyAllVi<strong>de</strong>os():void: <strong>de</strong>struye todos los ví<strong>de</strong>os que se estén reproduciendo actualmente.<br />

Ejemplo <strong>de</strong> uso <strong>de</strong> la API:<br />

import com.google.ads.studio.innovation.youtube.player.proxy.YTPlayer;<br />

function exitClicked(e:MouseEvent) {<br />

YTPlayer.pauseAllVi<strong>de</strong>os();<br />

}<br />

my_btn.addEventListener(MouseEvent.CLICK, exitClicked);<br />

.NOTA:. este componente <strong>de</strong>tendrá <strong>de</strong> forma automática todos los ví<strong>de</strong>os en cualquier clic <strong>de</strong> salida, por lo que el uso <strong>de</strong> estas funciones estará<br />

limitado.<br />

.<strong>Componente</strong> <strong><strong>de</strong>l</strong> <strong>reproductor</strong> <strong>de</strong> <strong>YouTube</strong>:.<br />

.Si no <strong>de</strong>sea usar el componente.<br />

¿Qué ocurre si no <strong>de</strong>sea usar el componente <strong>de</strong> arrastrar y soltar, sino que prefiere crear todo a través <strong>de</strong><br />

ActionScript y archivos <strong>de</strong> ActionScript externos? Pue<strong>de</strong> hacerlo sin ningún problema.<br />

Ejemplo <strong>de</strong> uso <strong>de</strong> la API:<br />

import com.google.ads.studio.innovation.youtube.player.proxy.YTPlayer;<br />

var ytp:YTPlayer = new YTPlayer();<br />

addChild(ytp);<br />

ytp.width = 320;<br />

ytp.height = 180<br />

ytp.version = 0;<br />

ytp.proxy.vi<strong>de</strong>oId = "7BOhDaJH0m4";<br />

ytp.proxy.autoPlayType = "preview";<br />

ytp.proxy.autoHi<strong>de</strong>Controls = true;<br />

.NOTA:. todas las funciones, métodos y usos <strong>de</strong> la API anteriores se pue<strong>de</strong>n utilizar con esta opción.<br />

Pue<strong>de</strong> consultar también un archivo .fla <strong>de</strong> ejemplo .aquí.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!