Форум Flasher.ru
Ближайшие курсы в Школе RealTime
Список интенсивных курсов: [см.]  
  
Специальные предложения: [см.]  
  
 
Блоги Правила Справка Пользователи Календарь Поиск рулит! Сообщения за день Все разделы прочитаны
 

Вернуться   Форум Flasher.ru > Flash > ActionScript 3.0

Версия для печати  Отправить по электронной почте    « Предыдущая тема | Следующая тема »  
Опции темы Опции просмотра
 
Создать новую тему Ответ
Старый 18.07.2012, 03:03
x.cent вне форума Посмотреть профиль Отправить личное сообщение для x.cent Найти все сообщения от x.cent
  № 1  
Ответить с цитированием
x.cent

Регистрация: May 2012
Сообщений: 3
Question Встроенный You Tube плеер, нет отображение fullscreen

Здравствуйте. Люди добрые помогите)!!!! Скачал сайт, искал, искал, решение проблемы, но так и не нашел...
Что нужно вписать в этот скрипт, что бы отобразилась кнопка FullScreen на плеере от YouTube? Подскажите пожалуйста, что вписать и куда вписать?


Код AS3:
package cj.qcreative.youtube {
 
	import flash.display.Sprite;
	import flash.display.Shape;
	import flash.display.Loader;
	import flash.events.Event;
	import flash.events.TimerEvent;
	import flash.events.IOErrorEvent;
	import flash.system.Security;
	import flash.net.URLLoader;
	import flash.net.URLRequest;
	import flash.utils.Timer;
	import cj.qcreative.Tracker;
	import cj.qcreative.gallery.GalleryTracker;
	import com.greensock.TweenLite;
	import com.greensock.easing.Quint;
 
	public final class YouTube extends Sprite {
 
		private var xLoader:URLLoader,
		vLoader:Loader,
		player:Object,
		quality:String,
		masker:Shape,
		vLoading:Boolean,
		xLoading:Boolean,
		goMask:Boolean,
		uGallery:Boolean,
		auto:Boolean,
		tim:Timer,
		vol:int,
		ww:int,
		hh:int;
 
		public function YouTube() {
 
			vLoading = false;
			xLoading = false;
 
			Security.allowDomain("www.youtube.com");
			Security.allowDomain("youtube.com");
 
			addEventListener(Event.UNLOAD, unloaded, false, 0, true);
 
			if(stage == null) {
				addEventListener(Event.ADDED_TO_STAGE, added, false, 0, true);
			}
			else {
				added();
			}
 
		}
 
		public function addRemove():void {
			addEventListener(Event.REMOVED_FROM_STAGE, unloaded, false, 0, true);
		}
 
		public function removeRemove():void {
			removeEventListener(Event.REMOVED_FROM_STAGE, unloaded);
		}
 
		private function added(event:Event = null):void {
 
			removeEventListener(Event.ADDED_TO_STAGE, added);
			addEventListener(Event.REMOVED_FROM_STAGE, unloaded, false, 0, true);
 
			var sh:Shape = Shape(getChildAt(0));
			ww = sh.width;
			hh = sh.height;
 
			if(GalleryTracker.homer != null) {
 
				if(Tracker.template) {
					Tracker.template.checkMusic(false);
				}
 
				uGallery = true;
				var url:String = "http://www.youtube.com/v/" + GalleryTracker.youID + "?version=3";
 
				vLoader = new Loader();
				vLoader.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, catchError, false, 0, true);
				vLoader.contentLoaderInfo.addEventListener(Event.COMPLETE, vLoaded, false, 0, true);
				vLoading = true;
				vLoader.load(new URLRequest(url));
			}
 
			else if(Tracker.template != null) {
 
				Tracker.template.checkMusic(false);
 
				uGallery = false;
				xLoader = new URLLoader();
				xLoader.addEventListener(IOErrorEvent.IO_ERROR, catchError, false, 0, true);
				xLoader.addEventListener(Event.COMPLETE, xLoaded, false, 0, true);
 
				var xString:String;
 
				xString = Tracker.youXML;
 
				if(xString == "") {
					xString = Tracker.textXML;
					goMask = true;
				}
				else {
					xString = "xml/youtube1.xml";
				}
 
				xLoading = true;
				xLoader.load(new URLRequest(xString));
			}
 
			else {
 
				var xString2:String = "xml/youtubesingle.xml";
				xLoader = new URLLoader();
				xLoader.addEventListener(IOErrorEvent.IO_ERROR, catchError, false, 0, true);
				xLoader.addEventListener(Event.COMPLETE, xLoaded, false, 0, true);
				xLoading = true;
				xLoader.load(new URLRequest(xString2));
 
			}
 
 
		}
 
		private function xLoaded(event:Event):void {
 
			xLoading = false;
 
			event.target.removeEventListener(IOErrorEvent.IO_ERROR, catchError);
			event.target.removeEventListener(Event.COMPLETE, xLoaded);
 
			var xml:XML = new XML(event.target.data);
 
			var url:String = "http://www.youtube.com/v/" + xml.videoURL + "?version=3", st:String = xml.autoPlay;
 
			if(st.toLowerCase() == "true") {
				auto = true;
			}
			else {
				auto = false;
			}
 
			vol = int(xml.videoVolume);
 
			vLoader = new Loader();
			vLoader.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, catchError, false, 0, true);
			vLoader.contentLoaderInfo.addEventListener(Event.COMPLETE, vLoaded, false, 0, true);
			vLoading = true;
			vLoader.load(new URLRequest(url));
 
		}
 
		public function getSized():void {
 
			Tracker.moduleW = ww;
			Tracker.moduleH = hh + 16;
			Tracker.template.posModule();
 
			if(goMask) {
				wipeMask(true);
			}
 
		}
 
		private function goTime(event:TimerEvent):void {
 
			tim.stop();
			tim.removeEventListener(TimerEvent.TIMER, goTime);
			tim = null;
 
			GalleryTracker.tubeReady = false;
 
		}
 
		private function onPlayerReady(event:Event):void {
 
			removeChildAt(0);
 
			player = vLoader.content;
 
			player.setSize(ww, hh);
 
			player.removeEventListener("onReady", onPlayerReady);
 
			if(uGallery) {
				tim = new Timer(500, 1);
				tim.addEventListener(TimerEvent.TIMER, goTime, false, 0, true);
				tim.start();
			}
			else if(Tracker.template) {
				player.setVolume(vol);
				Tracker.swfIsReady = true;
			}
			else {
 
				player.setVolume(vol);
				if(auto) {
					player.playVideo();
				}
 
			}
 
		}
 
		private function wipeMask(boo:Boolean = false):void {
 
			masker = new Shape();
			masker.graphics.beginFill(0x000000);
			masker.graphics.drawRect(0, 0, ww, hh);
			masker.graphics.endFill();
 
			masker.scaleX = 0;
 
			this.mask = masker;
 
			addChild(masker);
 
			if(!boo && !auto) {
				TweenLite.to(masker, 0.5, {scaleX: 1, ease: Quint.easeOut});
			}
			else {
				TweenLite.to(masker, 0.5, {scaleX: 1, ease: Quint.easeOut, onComplete: startPlay});
			}
 
		}
 
		private function startPlay():void {
 
			player.playVideo();
 
		}
 
		private function vLoaded(event:Event):void {
 
			vLoading = false;
 
			event.target.removeEventListener(IOErrorEvent.IO_ERROR, catchError);
			event.target.removeEventListener(Event.COMPLETE, vLoaded);
 
			vLoader.content.addEventListener("onReady", onPlayerReady, false, 0, true);
			vLoader.content.addEventListener("onError", catchError, false, 0, true);
 
			addChild(vLoader);
 
		}
 
		private function catchError(event:IOErrorEvent):void {};
 
		private function unloaded(event:Event):void {
 
			removeEventListener(Event.ADDED_TO_STAGE, added);
			removeEventListener(Event.UNLOAD, unloaded);
			removeEventListener(Event.REMOVED_FROM_STAGE, unloaded);
 
			if(player != null) {
				player.removeEventListener("onError", catchError);
				player.stopVideo();
				player.destroy();
			}
 
			if(xLoader != null) {
 
				xLoader.removeEventListener(IOErrorEvent.IO_ERROR, catchError);
				xLoader.removeEventListener(Event.COMPLETE, vLoaded);
 
				if(xLoading) {
					try {
						xLoader.close();
					}
					catch(event:*){};
				}
			}
 
			if(vLoader != null) {
 
				vLoader.contentLoaderInfo.removeEventListener(IOErrorEvent.IO_ERROR, catchError);
				vLoader.contentLoaderInfo.removeEventListener(Event.COMPLETE, vLoaded);
 
				if(vLoading) {
					try {
						vLoader.close();
					}
					catch(event:*){};
				}
 
				if(vLoader.content) {
					vLoader.unload();
				}
 
				if(this.contains(vLoader)) {
					removeChild(vLoader);
				}
 
			}
 
			if(masker != null) {
				TweenLite.killTweensOf(masker);
				masker.graphics.clear();
				removeChild(masker);
				masker = null;
			}
 
			if(tim != null) {
 
				tim.stop();
				tim.removeEventListener(TimerEvent.TIMER, goTime);
				tim = null;
 
			}
 
			vLoader = null;
			xLoader = null;
			player = null;
 
		}
 
	}
 
}

Создать новую тему Ответ Часовой пояс GMT +4, время: 01:22.
Быстрый переход
  « Предыдущая тема | Следующая тема »  

Теги
AS3 , fullscreen , player , youtube
Опции темы
Опции просмотра

Ваши права в разделе
Вы не можете создавать новые темы
Вы не можете отвечать в темах
Вы не можете прикреплять вложения
Вы не можете редактировать свои сообщения

BB коды Вкл.
Смайлы Вкл.
[IMG] код Вкл.
HTML код Выкл.


 


Часовой пояс GMT +4, время: 01:22.


Copyright © 1999-2008 Flasher.ru. All rights reserved.
Работает на vBulletin®. Copyright ©2000 - 2024, Jelsoft Enterprises Ltd. Перевод: zCarot
Администрация сайта не несёт ответственности за любую предоставленную посетителями информацию. Подробнее см. Правила.