HDTutorial
EN

Playback starts YouTube’s embedded player (privacy-enhanced mode).

Embed YouTube videos in Flash using AS3.0 - Flash Tutorials

9,391 views November 1, 2015 11:15

Watch on YouTube
ChannelVerkkoNet

Description from the creator

In this video lesson, you can learn how to play youtube video using AS3.0 and API (Application Programming Interface)

Website: samsolomonprabu.com/

Here's the source code:
----------------------------
import flash.display.Loader;
import flash.net.URLRequest;
import flash.events.Event;
import flash.ui.MouseCursor;

Security.allowDomain("www.youtube.c­om");

var player:Object;

var loader:Loader = new Loader();
loader.load(new URLRequest("youtube.com/apiplayer?vers...
loader.contentLoaderInfo.addEventListene­r(Event.INIT, onInit);

function onInit(e:Event):void{

addChild(loader);

player = loader.content;

player.addEventListener("onReady&qu­ot;,onPlayerReady);

}

function onPlayerReady(e:Event):void{

player.setSize(640,360);

player.loadVideoById("NBRqUqilRfY&q­uot;,0);

}

btnPlay.addEventListener(MouseEvent.CLIC­K, playVid);

function playVid(e:MouseEvent):void{

player.playVideo();

}

btnPause.addEventListener(MouseEvent.CLI­CK, pauseVid);

function pauseVid(e:MouseEvent):void{

player.pauseVideo();

}

btnStop.addEventListener(MouseEvent.CLIC­K, stopVid);

function stopVid(e:MouseEvent):void{

player.stopVideo();

}

btnMute.addEventListener(MouseEvent.CLIC­K, muteVid);

function muteVid(e:MouseEvent):void{

player.mute();

}

btnUnmute.addEventListener(MouseEvent.CL­ICK, UnmuteVid);

function UnmuteVid(e:MouseEvent):void{

player.unMute();

}

About this tutorial

VerkkoNet published this 11:15 video tutorial on November 1, 2015. It has been watched 9,391 times on YouTube.

Channel
VerkkoNet
Duration
11:15
Published
November 1, 2015
Views
9,391
Likes
48

Tags

Share

This tutorial in other languages