svnno****@sourc*****
svnno****@sourc*****
2009年 3月 22日 (日) 23:16:29 JST
Revision: 181 http://svn.sourceforge.jp/view?root=cinemaru&view=rev&rev=181 Author: tokita Date: 2009-03-22 23:16:28 +0900 (Sun, 22 Mar 2009) Log Message: ----------- flashのソースを更新 Added Paths: ----------- trunk/cinemaru/flash/player.zip Removed Paths: ------------- trunk/cinemaru/flash/CommentLabel.as trunk/cinemaru/flash/player.mxml trunk/cinemaru/flash/player.tgz Deleted: trunk/cinemaru/flash/CommentLabel.as =================================================================== --- trunk/cinemaru/flash/CommentLabel.as 2009-03-17 08:49:09 UTC (rev 180) +++ trunk/cinemaru/flash/CommentLabel.as 2009-03-22 14:16:28 UTC (rev 181) @@ -1,36 +0,0 @@ -// -// license http://www.opensource.org/licenses/mit-license.php MIT License -// - -package -{ - import mx.controls.Image; - import mx.controls.Label; - import mx.core.Application; - - public class CommentLabel extends Label - { - public var comment_time:uint = 0; - public var flg_show:Boolean = false; - public var flg_used:Boolean = false; - public var app:Application = null; - public var swf:Image = null; - public var has_swf:Boolean = false; - public var sp_cmd:Number = 0; - public var swf_no:Number = 0; - public var my_id:Number = 0; - - public function CommentLabel():void - { - super(); - } - - public function set_x(_x:Number):void { - this.x = _x; - } - - public function dec_x(n:Number):void { - this.x -= n; - } - } -} \ No newline at end of file Deleted: trunk/cinemaru/flash/player.mxml =================================================================== --- trunk/cinemaru/flash/player.mxml 2009-03-17 08:49:09 UTC (rev 180) +++ trunk/cinemaru/flash/player.mxml 2009-03-22 14:16:28 UTC (rev 181) @@ -1,1152 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> - -<!-- license http://www.opensource.org/licenses/mit-license.php MIT License --> - -<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" width="512" height="473" applicationComplete="init_func();" keyDown="onKeyDown(event);" horizontalScrollPolicy="off" verticalScrollPolicy="off"> - <mx:Script> - <![CDATA[ - - - import mx.effects.Effect; - import mx.effects.SoundEffect; - import mx.controls.Alert; - import mx.controls.Label; - import mx.events.FlexEvent; - import mx.events.VideoEvent; - import mx.core.UIComponent; - import mx.core.Application; - import flash.events.TimerEvent; - import flash.utils.Timer; - import flash.ui.Keyboard; - import flash.filters.*; - import flash.net.SharedObject; - import flash.net.URLLoader; - import flash.media.Sound; - - // サーバから読むコメントは1000件までとする - public var max_num_of_comment:Number = 1000; - - public var comments:Array = new Array(); - public var avatars:Array = new Array(); - public var swfs:Array = new Array(); - - public var flg_all_loaded:Boolean = false; - public var flg_all_loaded2:Boolean = false; - public var flg_show_comment:Boolean = true; - public var prev_time:String = ""; - public var flg_mp3:Boolean = false; - public var soundFactory:Sound; - public var song:SoundChannel; - public var song_stat:Number; - public var song_playhead_time:Number; - public var image:Image; - public var image_width:Number = 512; - public var image_height:Number = 384; - public var progress_stat:Number = 0; - public var my_avatar:Image = null; - public var avatar_size:Number = 24; - public var flg_focus_flv_seek:Boolean = false; - public var flg_image:Boolean = false; - public var main_image:Image = null; - public var flg_load_start:Boolean = false; - public var start_button:Button = null; - public var timer:Timer = null; - public var timer2:Timer = null; - public var file_url:String = null; - public var file_type:Number = 0; - - public function init_func():void { - timer = new Timer(100); - timer.addEventListener(TimerEvent.TIMER, moveWords); - - timer2 = new Timer(500); - timer2.addEventListener(TimerEvent.TIMER, draw_progress_image); - timer2.start(); - - - if (Application.application.parameters.autoplay) { - myVid.autoPlay = true; - flg_load_start = true; - timer.start(); - } else { - myVid.autoPlay = false; - flg_load_start = false; - - play_pause.enabled = false; - stop_button.enabled = false; - flvSeek.enabled = false; - volSeek.enabled = false; - no_comment.enabled = false; - } - - if (flg_load_start) { - load_file(); - } else { - flg_image = true; - } - - //Alert.show("i:" + Application.application.parameters.image_url); - - if (Application.application.parameters.image_url && (flg_load_start == false || is_mp3() == true)) { - //Alert.show('mp3'); - - var tmp_image_url:String = url_decode(Application.application.parameters.image_url); - - main_image = new Image(); - main_image.load(tmp_image_url); - - main_image.width = image_width; - main_image.height = image_height; - main_image.setStyle('horizontalAlign', 'center'); - main_image.setStyle('verticalAlign', 'center'); - - this.addChild(main_image); - } - - if (Application.application.parameters.avatar_size) { - avatar_size = int(Application.application.parameters.avatar_size); - } - - myVid.autoRewind = true; - - - var value:String; - for (var key:String in this.parameters) { - value = this.parameters[key]; - } - - // プログレスバーを白に - progress_image.graphics.beginFill(0xFFFFFF); - progress_image.graphics.drawRect(0, 0, 200, 9); - progress_image.graphics.endFill(); - - // コメント可/不可の設定 - if (this.parameters["comment_ng"]) { - comment_text.enabled = false; - submit.enabled = false; - } - - - - - - if (flg_load_start) { - // コメントをサーバから取得する - get_comment(); - } else { - start_button = new Button(); - start_button.label = 'START'; - start_button.x = 170; - start_button.y = 158; - start_button.width = 173; - start_button.height = 74; - start_button.setStyle('fontSize', 36); - start_button.addEventListener(flash.events.MouseEvent.CLICK, clickStartButton); - - addChild(start_button); - } - } - - private function is_mp3():Boolean { - if (Application.application.parameters.file_url != "") { - var file_url:String = Application.application.parameters.file_url; - - if (file_url.toLowerCase().match(/\.mp3$/)) { - return true; - } else { - return false; - } - } - - return false; - } - - private function load_file():void { - if (Application.application.parameters.file_url != "") { - file_url = url_decode(Application.application.parameters.file_url); - - var d:Date = new Date(); - if (file_url.toLowerCase().match(/\.mp3$/)) { - file_type = 1; - - var request:URLRequest = new URLRequest(file_url + '?' + d.getTime()); - soundFactory = new Sound(); - - soundFactory.addEventListener(Event.COMPLETE, completeHandler); - soundFactory.addEventListener(Event.ID3, id3Handler); - soundFactory.addEventListener(IOErrorEvent.IO_ERROR, ioErrorHandler); - soundFactory.addEventListener(ProgressEvent.PROGRESS, progressHandler); - soundFactory.load(request); - - flg_mp3 = true; - - song = soundFactory.play(0, 0); - song_stat = 1; - - song.addEventListener(Event.SOUND_COMPLETE, songCompleteHandler); - - flg_image = true; - } else if (file_url.toLowerCase().match(/\.flv$/)) { - file_type = 2; - - myVid.source = file_url + '?' + d.getTime(); - myVid.addEventListener(mx.events.VideoEvent.COMPLETE, songCompleteHandler); - flg_mp3 = false; - } else if (file_url.toLowerCase().match(/^http:\/\/[a-z]+\.youtube\.com/)) { - file_type = 3; - - get_youtube_flv_url(file_url); - //Alert.show('file_url:' + file_url); - //myVid.source = file_url; - - //myVid.source = 'http://jp.youtube.com/get_video?video_id=FgNqLSwoAcU&t=OEgsToPDskIUYSj5_3M0fTFYQigmrlQq'; - - flg_mp3 = false; - } - - volume_init(); - } - } - - private function volume_init():void { - var sp:SharedObject = SharedObject.getLocal("player"); - - // ボリュームの初期値 - if (flg_mp3) { - var vol:Number = 0; - if (sp.data.volume) { - volSeek.value = sp.data.volume; - vol = sp.data.volume; - } else { - vol = 75; - sp.data.volume = 75; - sp.flush(); - } - - var transform:SoundTransform = song.soundTransform; - if (vol) { - transform.volume = vol / 100; - } else { - transform.volume = 0; - } - song.soundTransform = transform; - } else { - if (sp.data.volume) { - volSeek.value = sp.data.volume; - if (sp.data.volume == "0") { - myVid.volume = 0; - } else { - myVid.volume = sp.data.volume / 100; - } - } else { - volSeek.value = 75; - sp.data.volume = "" + 75; - myVid.volume = 75 / 100; - sp.flush(); - } - } - - // コメント表示/非表示の設定 - if (sp.data.nocomment) { - if (sp.data.nocomment == 1) { - flg_show_comment = true; - } else if (sp.data.nocomment == 2) { - flg_show_comment = false; - } - } - } - - private function completeHandler(event:Event):void { - flvSeek.setStyle("maximum", soundFactory.length / 1000); - flvSeek.maximum = int(soundFactory.length / 1000); - flg_all_loaded = true; - - trace("completeHandler: " + event); - } - - private function id3Handler(event:Event):void { - trace("id3Handler: " + event); - } - - private function ioErrorHandler(event:Event):void { - trace("ioErrorHandler: " + event); - } - - private function progressHandler(event:ProgressEvent):void { - - trace("progressHandler: " + event); - } - - private function songCompleteHandler(event:Event):void { - // 再生が終了した - - click_stop(); - - if (timer != null) { - timer.stop(); - timer = null; - } - - trace("completeHandler: " + event); - } - - public function get_comment():void { - var url:String; - if (this.parameters["baseurl"]) { - url = this.parameters["baseurl"]; - } else { - return; - } - url = url + 'movie_comment_get.php'; - - var request:URLRequest = new URLRequest(url); - var params:URLVariables = new URLVariables(); - params.id = this.parameters["id"]; - - request.method = URLRequestMethod.GET; - request.data = params; - - var loader:URLLoader = new URLLoader(); - loader.addEventListener(Event.COMPLETE, onGetCommentComplete); - - loader.load(request); - - } - - public function get_youtube_flv_url(file_url:String):String { - var url:String; - if (this.parameters["baseurl"]) { - url = this.parameters["baseurl"]; - } else { - return ''; - } - url = url + 'get_youtube_flv_url.php'; - - var request:URLRequest = new URLRequest(url); - var params:URLVariables = new URLVariables(); - params.url = file_url; - - request.method = URLRequestMethod.GET; - request.data = params; - - var loader:URLLoader = new URLLoader(); - loader.addEventListener(Event.COMPLETE, onGetYoutubeFlvUrlComplete); - - loader.load(request); - - //Alert.show('youtube url:' + url); - - return file_url; - } - - public function onGetCommentComplete(event:Event):void { - var s:String = event.target.data as String; - if (s == null || s == "") { - return; - } - var lines:Array = s.split("\n"); - for (var i:int = 0; i < lines.length; i++) { - var line:String = lines[i]; - if (line == null || line == "") { - continue; - } - var a:Array = new Array(); - a = line.match(/(^(\d+),([^,]*),(.+)$)/); - - var y:Number = Math.random() * 300; - - var sp_cmd:Boolean = false; - var sp_cmd_no:Number = 0; - var b:Array = new Array(); - b = a[4].match(/^cmd:(.+)$/); - if (b) { - sp_cmd = true; - - if (Application.application.parameters.spcmd1 == b[1]) { - sp_cmd_no = 1; - } else if (Application.application.parameters.spcmd2 == b[1]) { - sp_cmd_no = 2; - } else if (Application.application.parameters.spcmd3 == b[1]) { - sp_cmd_no = 3; - } - } - - if (sp_cmd == false && a[3] != '') { - var avatar:Image = new Image(); - avatar.load(a[3]); - avatar.width = avatar_size; - avatar.height = avatar_size; - avatar.x = 550 - avatar_size; - avatar.y = y + (avatar_size / 2); - avatars[i] = avatar; - addChild(avatar); - } - - var com:CommentLabel = new CommentLabel(); - com.app = this; - com.sp_cmd = sp_cmd_no; - com.my_id = i; - - com.comment_time = a[2]; - com.flg_show = false; - com.enabled = true; - - if (sp_cmd) { - com.text = null; - - com.has_swf = true; - } else { - var filter:GlowFilter = new GlowFilter(); - filter.color = 0; - - com.text = a[4]; - com.setStyle("fontSize", 30); - com.setStyle("color", 0xFFFFFF); - com.filters = [filter]; - if (flg_show_comment == false) { - com.setVisible(false); - } - } - - com.set_x(550); - com.y = y; - addChild(com); - comments[i] = com; - } - } - - public function onGetYoutubeFlvUrlComplete(event:Event):void { - var s:String = event.target.data as String; - //Alert.show('onGetYoutubeFlvUrlComplete:' + s); - if (s == null || s == "") { - return; - } - file_url = s; - myVid.source = file_url; - play_and_pause(); - //Alert.show('myVid.source:' + myVid.source); - - // プログレスバーを白に - progress_image.graphics.beginFill(0xFFFFFF); - progress_image.graphics.drawRect(0, 0, 200, 9); - progress_image.graphics.endFill(); - } - - /** ボリュームコントロール */ - public function change_vol(vol:Number):void { - if (flg_mp3) { - var transform:SoundTransform = song.soundTransform; - if (vol) { - transform.volume = vol / 100; - } else { - transform.volume = 0; - } - song.soundTransform = transform; - } else { - if (vol) { - myVid.volume = vol / 100; - } else { - myVid.volume = 0; - } - } - - // ボリュームを SharedObject に覚えされる - var sp:SharedObject = SharedObject.getLocal("player"); - sp.data.volume = "" + vol; - sp.flush(); - } - - public function draw_progress_image(event:Event):void { - // プログレスバーを進める - - if (flg_load_start == false) { - // ファイルを読み込んでない - return; - } - - if (flg_all_loaded2) { - - return; - } - - //if (flg_all_loaded && 10000 < progress_stat) { - if (flg_all_loaded) { - // 全て読み込み済み - - progress_image.graphics.beginFill(0x9999FF); - progress_image.graphics.drawRect(0, 0, 200, 9); - progress_image.graphics.endFill(); - - flg_all_loaded2 = true; - - timer2.stop(); - - return; - } - - var bytesLoaded:Number; - var bytesTotal:Number; - - if (flg_mp3) { - bytesLoaded = soundFactory.bytesLoaded; - bytesTotal = soundFactory.bytesTotal; - } else { - bytesLoaded = myVid.bytesLoaded; - bytesTotal = myVid.bytesTotal; - } - - progress_image.graphics.beginFill(0x9999FF); - var p:uint = 0; - if (bytesLoaded == 0 || bytesTotal == 0) { - p = 1; - } else { - p = (bytesLoaded / bytesTotal) * 200; - } - progress_image.graphics.drawRect(0, 0, p, 9); - progress_image.graphics.endFill(); - - if (0 < bytesTotal && bytesLoaded == bytesTotal) { - // 全て読み込み済み - flg_all_loaded = true; - return; - } - - progress_stat++; - } - - public function draw_time():void { - var tmp:String; - var p_min:uint; - var p_sec:uint; - var t_min:uint; - var t_sec:uint; - - if (flg_mp3) { - p_min = int(song.position / 1000) / 60; - p_sec = int(song.position / 1000) % 60; - t_min= int(soundFactory.length / 1000) / 60; - t_sec = int(soundFactory.length / 1000) % 60; - tmp = "" + p_min + ":" + p_sec + "/" + t_min + ":" + t_sec; - } else { - p_min = int(myVid.playheadTime) / 60; - p_sec = int(myVid.playheadTime) % 60; - t_min = int(myVid.totalTime) / 60; - t_sec = int(myVid.totalTime) % 60; - if (59 < t_sec) { - t_sec = 0; - } - tmp = "" + p_min + ":" + p_sec + "/" + t_min + ":" + t_sec; - } - if (tmp == prev_time) { - return; - } - time_count.text = tmp; - prev_time = tmp; - } - - public function moveWords(event:TimerEvent):void { - - - - if (flg_focus_flv_seek == false) { - if (flg_mp3) { - if (flg_all_loaded && int(song.position/1000) != int(soundFactory.length/1000)) { - flvSeek.value = song.position / 1000; - } - } else { - flvSeek.value = myVid.playheadTime; - } - - //draw_progress_image(); - } - - if (flg_mp3) { - if (song_stat != 1) { - // 再生中以外はコメントを動かさない - return; - } - } else { - if (myVid.state != VideoEvent.PLAYING) { - // 再生中以外はコメントを動かさない - // Alert.show('hit'); - // reset_comments(); - - return; - } - } - - draw_time(); - - for (var i:int = 0; i < max_num_of_comment; i++) { - if (comments[i]) { - // コメントがあった - - if (comments[i].flg_show == true && -10 < comments[i].x + comments[i].textWidth) { - // 該当コメント表示中 - comments[i].dec_x(20); - if (avatars[i]) { - avatars[i].x -= 20; - } - } else { - - // 該当コメント未表示 - var ct:uint = comments[i].comment_time; - - var vt:uint; - if (flg_mp3) { - vt = song.position; - } else { - vt = (myVid.playheadTime * 1000); - } - - if (comments[i].flg_used == false && ct <= (vt + 200)) { - // コメント表示タイミングが来た - - - show_comment(comments[i]); - comments[i].set_x(450); - - if (avatars[i]) { - if (flg_show_comment == 1) { - avatars[i].visible = true; - } else { - avatars[i].visible = false; - } - avatars[i].x = 450 - avatar_size; - } - - - } - - if (comments[i].flg_used) { - // コメントが見えなくなった - - if (swfs[i] != null && comments[i].x < 0) { - - swfs[i].setVisible(false); - removeChild(swfs[i]); - swfs[i] = null; - } - - } - - } - } else { - break; - } - } - } - - - public function clickStartButton(event:Event):void { - start_button.visible = false; - flg_mp3 = is_mp3(); - - flg_all_loaded = false; - progress_stat = 0; - - flg_load_start = true; - load_file(); - get_comment(); - - start_button.visible = false; - - play_pause.enabled = true; - stop_button.enabled = true; - flvSeek.enabled = true; - volSeek.enabled = true; - no_comment.enabled = true; - - clickStartButton2(); - - return; - - - } - - public function clickStartButton2():void { - - if (timer == null) { - timer = new Timer(100); - timer.addEventListener(TimerEvent.TIMER, moveWords); - } - timer.start(); - - if (flg_mp3) { - draw_time(); - //draw_progress_image(); - - song_stat = 1; - } else { - - if (file_type != 3) { - myVid.autoPlay = true; - myVid.play(); - } - - if (main_image) { - main_image.visible = false; - } - if (myVid.source != null && myVid.source != '') { - play_and_pause(); - } - } - - // プログレスバーを白に - progress_image.graphics.beginFill(0xFFFFFF); - progress_image.graphics.drawRect(0, 0, 200, 9); - progress_image.graphics.endFill(); - } - - public function play_and_pause():void { - draw_time(); - //draw_progress_image(); - - if (flg_mp3) { - if (song_stat == 1) { - // 再生→一時停止 - - song_playhead_time = song.position; - song.stop(); - song_stat = 2; - reset_comments(); - - if (timer != null) { - timer.stop(); - timer = null; - } - - } else if (song_stat == 2) { - // 一時停止→再生 - - song = soundFactory.play(song_playhead_time, 0); - song_stat = 1; - set_volume(); - reset_comments(); - - if (timer == null) { - timer = new Timer(100); - timer.addEventListener(TimerEvent.TIMER,moveWords); - } - timer.start(); - - } else { - // 停止→再生 - - if (timer == null) { - timer = new Timer(100); - timer.addEventListener(TimerEvent.TIMER,moveWords); - } - timer.start(); - - if (flg_load_start == false) { - flg_load_start = true; - } - - song = soundFactory.play(0, 0); - song_stat = 1; - flvSeek.value = 0; - set_volume(); - reset_comments(); - } - } else { - if (myVid.state == VideoEvent.PLAYING) { - // 再生→一時停止 - - if (timer != null) { - timer.stop(); - timer = null; - } - - reset_comments(); - myVid.pause(); - } else { - // 一時停止→再生 - - if (timer == null) { - timer = new Timer(100); - timer.addEventListener(TimerEvent.TIMER,moveWords); - } - timer.start(); - - if (flg_load_start == false) { - flg_load_start = true; - start_button.visible = false; - } - - reset_comments(); - myVid.play(); - } - } - } - - // 音量のスラーダーに合わせて音量を設定。MP3のみ - public function set_volume():void { - if (flg_mp3) { - // 音量を設定 - var transform:SoundTransform = song.soundTransform; - if (volSeek.value) { - transform.volume = volSeek.value / 100; - } else { - transform.volume = 0; - } - song.soundTransform = transform; - } - } - - public function onKeyDown(event:KeyboardEvent):void { - var code:uint = event.keyCode; - - if (code == Keyboard.ENTER) { - click_submit(); - } - } - - // コメントのボタンが押された - public function click_submit():void { - - if (comment_text.text == "") { - // 何もしない - } else { - if (flg_mp3) { - if (song_stat == 0) { - return; - } - } else { - if (myVid.state != VideoEvent.PLAYING) { - return; - } - } - - var sp_cmd:Boolean = false; - - - var b:Array = new Array(); - var sp_cmd_no:Number = 0; - b = comment_text.text.match(/^cmd:(.+)$/); - if (b) { - sp_cmd = true; - if (Application.application.parameters.spcmd1 == b[1]) { - sp_cmd_no = 1; - } else if (Application.application.parameters.spcmd2 == b[1]) { - sp_cmd_no = 2; - } else if (Application.application.parameters.spcmd3 == b[1]) { - sp_cmd_no = 3; - } else { - // コマンドが一致しない - return; - } - } - - - var url:String; - if (this.parameters["baseurl"]) { - url = this.parameters["baseurl"]; - } else { - return; - } - url = url + 'movie_comment_post.php'; - - var request:URLRequest = new URLRequest(url); - var params:URLVariables = new URLVariables(); - params.comment = comment_text.text; - if (flg_mp3) { - params.time = song.position / 1000; - } else { - params.time = myVid.playheadTime; - } - params.t = Math.random() * 100; - params.id = this.parameters["id"]; - - request.method = URLRequestMethod.GET; - request.data = params; - - var loader:URLLoader = new URLLoader(); - loader.addEventListener(Event.COMPLETE, onComplete); - - loader.load(request); - - - var filter:GlowFilter = new GlowFilter(); - filter.color = 0; - - var y:Number = Math.random() * 300; - - if (sp_cmd == false && Application.application.parameters.avatar_url) { - var avatar:Image = new Image(); - avatar.load(Application.application.parameters.avatar_url); - avatar.width = avatar_size; - avatar.height = avatar_size; - avatar.x = 450 - avatar_size; - avatar.y = y + (avatar_size / 2); - avatars[comments.length] = avatar; - addChild(avatar); - } - - var com:CommentLabel = new CommentLabel(); - com.comment_time = (myVid.playheadTime * 1000); - com.flg_show = true; - com.flg_used = true; - com.y = y; - com.my_id = comments.length; - - if (sp_cmd) { - com.text = null; - com.x = 450; - com.has_swf = true; - - com.sp_cmd = sp_cmd_no; - show_comment(com); - - - } else { - com.text = comment_text.text; - com.setStyle("fontSize", 30); - com.setStyle("color", 0xFFFFFF); - com.filters = [filter]; - com.x = 450; - com.y = y; - } - - addChild(com); - comments.push(com); - - comment_text.text = ""; - } - } - - public function onComplete(event:Event):void { - - } - - // コメント表示/非表示切り替え - public function toggle_comment():void { - for (var i:int = 0; i < max_num_of_comment; i++) { - if (comments[i]) { - if (flg_show_comment) { - comments[i].setVisible(false); - if (swfs[i]) { - swfs[i].setVisible(false); - } - if (avatars[i]) { - avatars[i].setVisible(false); - } - } else { - comments[i].setVisible(true); - if (swfs[i]) { - swfs[i].setVisible(true); - } - if (avatars[i]) { - avatars[i].setVisible(true); - } - } - } - } - - var sp:SharedObject = SharedObject.getLocal("player"); - if (flg_show_comment) { - sp.data.nocomment = 2; - flg_show_comment = false; - } else { - sp.data.nocomment = 1; - flg_show_comment = true; - } - sp.flush(); - } - - public function onChangeHSlider():void { - if (flg_mp3) { - // 一旦止めて、再生位置を指定して再開する - song.stop(); - song = soundFactory.play(flvSeek.value * 1000); - - // 一旦停止すると音量が戻るので設定し直す - set_volume(); - } else { - if (flvSeek.value < myVid.bytesLoaded) { - myVid.playheadTime = flvSeek.value; - } - } - draw_time(); - //draw_progress_image(); - - reset_comments(); - } - - public function reset_comments():void { - for (var i:int = 0; i < max_num_of_comment; i++) { - if (swfs[i] != null) { - swfs[i].setVisible(false); - removeChild(swfs[i]); - swfs[i] = null; - } - if (comments[i]) { - - var v:Number; - if (flvSeek.value == 0) { - v = 0; - } else { - v = flvSeek.value * 1000; - } - - comments[i].flg_show = false; - if (comments[i].comment_time < v) { - comments[i].flg_used = true; - } else { - comments[i].flg_used = false; - } - comments[i].set_x(550); - if (avatars[i]) { - avatars[i].x = 550 - avatar_size; - } - } - } - - } - - public function click_stop():void { - if (flg_mp3) { - song.stop(); - song_stat = 0; - } else { - myVid.stop(); - } - - if (timer != null) { - timer.stop(); - timer = null; - } - - flvSeek.value = 0; - - reset_comments(); - } - - public function onMouseOver():void { - flg_focus_flv_seek = true; - } - - public function onMouseOut():void { - flg_focus_flv_seek = false; - } - - public function show_comment(com:CommentLabel):void { - if (com.has_swf) { - - var url:String = null; - var flg_random:String = ''; - if (com.sp_cmd == 1) { - url = Application.application.parameters.spcmd1_url; - flg_random = Application.application.parameters.spcmd1r; - } else if (com.sp_cmd == 2) { - url = Application.application.parameters.spcmd2_url; - flg_random = Application.application.parameters.spcmd2r; - } else if (com.sp_cmd == 3) { - url = Application.application.parameters.spcmd3_url; - flg_random = Application.application.parameters.spcmd3r; - } - - if (url != '') { - com.swf = new Image(); - com.swf.load(url); - com.swf.x = 0; - if (flg_random == "1") { - com.swf.y = com.y + 25; - } else { - com.swf.y = 0; - } - - if (flg_show_comment == 1) { - com.swf.setVisible(true); - } else { - com.swf.setVisible(false); - } - - addChild(com.swf); - - - - swfs[com.my_id] = com.swf; - } - } - com.flg_show = true; - com.flg_used = true; - } - - -private function url_decode(url:String):String { - var out:String = ''; - var s:String = ''; - var p:Number = 0; - - var map:Array = new Array(); - - map['26'] = '&'; - map['2F'] = '/'; - map['3A'] = ':'; - map['3D'] = '='; - map['3F'] = '?'; - - while (true) { - s = url.substr(p, 1); - - if (s == '%') { - var t1:String = url.substr(p + 1, 2); - out += '' + map[t1]; - p += 3; - continue; - } - - if (s == '') { - break; - } - - out += s; - - p++; - if (200 < p) { - break; - } - - } - - return out; -} - - ]]> - </mx:Script> - - - <!-- ビデオ画面 --> - <mx:VideoDisplay id="myVid" height="384" width="512" source="" /> - - <!-- 停止ボタン--> - <mx:Button label="Stop" click="click_stop();" x="113" y="392" id="stop_button"/> - - <!-- 再生スライダー--> - <mx:HSlider id="flvSeek" x="173.65" y="398" maximum="{myVid.totalTime}" - mouseOver="onMouseOver();" mouseOut="onMouseOut();" - change="onChangeHSlider();" height="20" width="215"/> - - <!--音量スライダー --> - <mx:HSlider x="464" y="422" width="38" id="volSeek" change="change_vol(volSeek.value);" minimum="0" maximum="100" height="20"/> - - <!-- 再生&停止ボタン --> - <mx:Button x="10" y="392" label="Play&Pause" id="play_pause" click="play_and_pause();" /> - - <!-- コメント入力 --> - <mx:TextInput x="10" y="420" width="266" id="comment_text" maxChars="200" editable="true" enabled="true"/> - - <!-- コメント投稿 --> - <mx:Button x="284" y="420" label="submit" id="submit" click="click_submit();"/> - - <!-- 時間 --> - <mx:Text x="396" y="394" text="00:00/00:00" width="91" color="#FFFFFF" id="time_count"/> - - <!-- プログレスバー --> - <mx:Image x="181" y="392" width="200" height="9" id="progress_image" themeColor="#FFFFFF" alpha="0.78"/> - - <!-- コメント表示/非表示ボタン--> - <mx:Button x="357" y="420" label="No Comment" id="no_comment" click="toggle_comment();"/> - -</mx:Application> Deleted: trunk/cinemaru/flash/player.tgz =================================================================== (Binary files differ) Added: trunk/cinemaru/flash/player.zip =================================================================== (Binary files differ) Property changes on: trunk/cinemaru/flash/player.zip ___________________________________________________________________ Added: svn:mime-type + application/octet-stream