Develop and Download Open Source Software

Browse Subversion Repository

Annotation of /NNDDv2/trunk/src/org/mineap/nndd/view/VideoInfoView.as

Parent Directory Parent Directory | Revision Log Revision Log


Revision 869 - (hide annotations) (download)
Sat Jun 16 06:36:05 2012 UTC (11 years, 9 months ago) by mineap
File size: 60417 byte(s)
InfoViewで、投稿者説明文の表示領域の大きさを調整できるようにした
1 mineap 370 /**
2     * VideoInfoView.as
3     *
4     * Copyright (c) 2008-2009 MAP - MineApplicationProject. All Rights Reserved.
5     *
6     * @author shiraminekeisuke
7     *
8     */
9    
10 mineap 628 import flash.display.StageDisplayState;
11 mineap 498 import flash.display.StageQuality;
12 mineap 370 import flash.events.Event;
13     import flash.events.MouseEvent;
14     import flash.events.NativeWindowBoundsEvent;
15     import flash.events.TextEvent;
16     import flash.geom.Rectangle;
17 mineap 498 import flash.sampler.getInvocationCount;
18 mineap 370 import flash.utils.Timer;
19    
20     import mx.collections.ArrayCollection;
21     import mx.collections.Sort;
22     import mx.collections.SortField;
23     import mx.controls.Alert;
24     import mx.controls.CheckBox;
25 mineap 628 import mx.controls.ComboBox;
26 mineap 370 import mx.controls.DataGrid;
27     import mx.controls.HSlider;
28     import mx.controls.RadioButton;
29     import mx.core.Application;
30     import mx.core.DragSource;
31 mineap 498 import mx.core.FlexGlobals;
32 mineap 526 import mx.core.Window;
33 mineap 370 import mx.events.AIREvent;
34     import mx.events.CloseEvent;
35     import mx.events.DataGridEvent;
36     import mx.events.DragEvent;
37     import mx.events.FlexEvent;
38     import mx.events.ListEvent;
39 mineap 507 import mx.events.NumericStepperEvent;
40 mineap 370 import mx.events.SliderEvent;
41    
42 mineap 439 import org.mineap.nicovideo4as.model.SearchType;
43 mineap 370 import org.mineap.nndd.LogManager;
44     import org.mineap.nndd.Message;
45     import org.mineap.nndd.model.NNDDVideo;
46     import org.mineap.nndd.model.PlayList;
47     import org.mineap.nndd.model.SearchItem;
48     import org.mineap.nndd.model.SearchSortString;
49     import org.mineap.nndd.playList.PlayListManager;
50     import org.mineap.nndd.player.PlayerController;
51 mineap 628 import org.mineap.nndd.util.DataGridColumnWidthUtil;
52 mineap 370 import org.mineap.nndd.util.PathMaker;
53     import org.mineap.util.config.ConfUtil;
54     import org.mineap.util.config.ConfigManager;
55 mineap 628 import org.mineap.util.font.FontUtil;
56 mineap 370
57     private var videoPlayer:VideoPlayer;
58     private var playerController:PlayerController;
59     private var logManager:LogManager;
60    
61     public var isPlayListRepeat:Boolean = false;
62     public var isSyncComment:Boolean = true;
63     public var isPlayerFollow:Boolean = true;
64     public var isRenewCommentEachPlay:Boolean = false;
65     public var isRenewOtherCommentWithCommentEachPlay:Boolean = false;
66     public var isResizePlayerEachPlay:Boolean = true;
67     public var isHideUnderController:Boolean = false;
68     public var commentScale:Number = 1.0;
69     public var fps:Number = 15;
70     public var isShowOnlyPermissionComment:Boolean = false;
71 mineap 507 public var showCommentCountPerMin:int = 50;
72     public var showOwnerCommentCountPerMin:int = 50;
73 mineap 370 public var showCommentSec:int = 3;
74     public var isAntiAlias:Boolean = true;
75     public var commentAlpha:int = 100;
76     public var isEnableJump:Boolean = true;
77     public var isAskToUserOnJump:Boolean = true;
78     public var isInfoViewAlwaysFront:Boolean = false;
79     public var isCommentFontBold:Boolean = true;
80     public var isShowAlwaysNicowariArea:Boolean = false;
81     public var selectedResizeType:int = RESIZE_TYPE_NICO;
82     public var isAlwaysEconomyForStreaming:Boolean = false;
83     public var isHideTagArea:Boolean = false;
84     public var isAppendComment:Boolean = false;
85     public var isHideSekaShinComment:Boolean = false;
86     public var isShowHTMLOwnerComment:Boolean = true;
87     public var isEnableWideMode:Boolean = true;
88 mineap 799 public var useOldVersionVideoSize:Boolean = false;
89 mineap 370 public var relationSortIndex:int = 0;
90     public var relationOrderIndex:int = 0;
91     public var isNgUpEnable:Boolean = true;
92 mineap 487 public var isSmoothing:Boolean = true;
93 mineap 529 public var isSmoothingOnlyNotPixelIdenticalDimensions:Boolean = true;
94 mineap 498 public var playerQuality:int = 2;
95 mineap 526 public var isFollowInfoViewHeight:Boolean = false;
96 mineap 605 public var isNotPlayNicowari:Boolean = false;
97 mineap 711 public var isOpenFileDialogWhenOpenPlayer:Boolean = false;
98 mineap 824 public var is184:Boolean = true;
99 mineap 860 public var useDarkColor:Boolean = false;
100 mineap 869 public var ownerCommentTextSize:int = 70;
101 mineap 370
102     public static const RESIZE_TYPE_NICO:int = 1;
103     public static const RESIZE_TYPE_VIDEO:int = 2;
104    
105     public var videoUrlMap:Object = new Object();
106    
107     public var myListMap:Object = new Object();
108    
109     private var lastRect:Rectangle = new Rectangle();
110    
111     private var seekTimer:Timer;
112     private var seekValue:Number = 0;
113    
114     public var isActive:Boolean = false;
115    
116     public var playListName:String = "";
117    
118     [Bindable]
119     public var commentListProvider:ArrayCollection = new ArrayCollection();
120     [Bindable]
121     public var ownerCommentProvider:ArrayCollection = new ArrayCollection();
122     [Bindable]
123     private var playListProvider:ArrayCollection = new ArrayCollection();
124     [Bindable]
125     public var localTagProvider:Array = new Array();
126     [Bindable]
127     public var nicoTagProvider:Array = new Array();
128     [Bindable]
129     public var ichibaLocalProvider:ArrayCollection = new ArrayCollection();
130     [Bindable]
131     public var ichibaNicoProvider:ArrayCollection = new ArrayCollection();
132     [Bindable]
133     public var ngListProvider:ArrayCollection = new ArrayCollection();
134     [Bindable]
135     public var owner_text_nico:String = "";
136     [Bindable]
137     public var owner_text_local:String = "";
138     [Bindable]
139     private var myListDataProvider:Array = new Array();
140     [Bindable]
141     public var savedCommentListProvider:Array = new Array();
142     [Bindable]
143     public var owner_text_temp:String = "";
144     [Bindable]
145     public var relationDataProvider:ArrayCollection = new ArrayCollection();
146     [Bindable]
147     public var relationSortComboboxDataProvider:Array = new Array("���������������", "���������������", "���������", "���������");
148     [Bindable]
149     public var relationOrderComboboxDataProvider:Array = new Array("������", "������");
150     [Bindable]
151     private var label_playListTitle_dataProvider:String = "";
152 mineap 484 [Bindable]
153     public var videoType:String = "";
154     [Bindable]
155     public var connectionType:String = "";
156     [Bindable]
157     public var videoServerUrl:String = "";
158     [Bindable]
159     public var messageServerUrl:String = "";
160 mineap 490 [Bindable]
161     public var economyMode:String = "";
162     [Bindable]
163     public var nickName:String = "";
164     [Bindable]
165     public var isPremium:String = "";
166     [Bindable]
167     public var pubUserNameIconUrl:String = "";
168     [Bindalbe]
169     public var pubUserName:String = "";
170     [Bindalbe]
171     public var pubUserLinkButtonText:String = "";
172 mineap 796 [Bindable]
173     public var currentWindowSize:String = "";
174     [Bindable]
175     public var format:String = "";
176     [Bindable]
177     public var videoSize:String = "";
178 mineap 370
179     public function init(playerController:PlayerController, videoPlayer:VideoPlayer, logManager:LogManager):void{
180     this.videoPlayer = videoPlayer;
181     this.playerController = playerController;
182     this.logManager = logManager;
183    
184     this.addEventListener(FlexEvent.CREATION_COMPLETE, function(event:FlexEvent):void{
185     stage.addEventListener(AIREvent.WINDOW_ACTIVATE, function(event:AIREvent):void{
186     isActive = true;
187     });
188     stage.addEventListener(AIREvent.WINDOW_DEACTIVATE, function(event:AIREvent):void{
189     isActive = false;
190     });
191     });
192    
193     readStore();
194     }
195    
196     public function resetInfo():void{
197     localTagProvider = new Array();
198     nicoTagProvider = new Array();
199     ichibaLocalProvider = new ArrayCollection();
200     ichibaNicoProvider = new ArrayCollection();
201    
202     owner_text_local = "";
203     owner_text_nico = "";
204     owner_text_temp = "";
205     }
206    
207     private function windowClosing(event:Event):void{
208    
209     event.preventDefault();
210    
211     // if(this.videoPlayer != null && !this.videoPlayer.closed){
212     // this.videoPlayer.close();
213     // }
214     //
215     // this.playerController.destructor();
216    
217     this.visible = false;
218    
219     }
220    
221     private function play():void{
222     this.playerController.play();
223     }
224    
225     private function stop():void{
226     this.playerController.stop();
227     }
228    
229     private function checkBoxAppendCommentChanged(event:Event):void{
230     this.isAppendComment = event.target.selected;
231 mineap 529 FlexGlobals.topLevelApplication.setAppendComment(this.isAppendComment);
232 mineap 370 }
233    
234     public function setAppendComment(boolean:Boolean):void{
235     this.isAppendComment = boolean;
236     if(checkBox_isAppendComment != null){
237     checkBox_isAppendComment.selected = boolean;
238     }
239     }
240    
241     public function relationItemDoubleClickHandler(event:ListEvent):void{
242     if(relationDataProvider.length > event.rowIndex){
243     var url:String = relationDataProvider[event.rowIndex].col_link;
244     if(url != null && url.length > 0){
245     var videoId:String = PathMaker.getVideoID(url);
246     if(videoId != null){
247     playerController.playMovie(url);
248     }
249     }
250     }
251     }
252    
253     public function checkBoxNgUpChanged(event:Event):void{
254     this.isNgUpEnable = checkBox_isNgUpEnable.selected;
255     if(this.playerController != null){
256     this.playerController.reloadLocalComment();
257     }
258     }
259    
260 mineap 796 public function checkBoxIsLengthwisePreferredChanged(event:Event):void
261     {
262     var checkBox:CheckBox = (event.currentTarget as CheckBox);
263    
264     if (checkBox.selected)
265     {
266     ConfigManager.getInstance().setItem("isLengthwisePreferred", "true");
267     }
268     else
269     {
270     ConfigManager.getInstance().setItem("isLengthwisePreferred", "false");
271     }
272 mineap 797
273     this.playerController.isLengthwisePreferred = checkBox.selected;
274    
275 mineap 796 ConfigManager.getInstance().save();
276     }
277    
278 mineap 487 public function checkBoxSmoothingChanged(event:Event):void{
279     this.isSmoothing = checkBox_isSmoothing.selected;
280 mineap 529 checkBox_isSmoothingOnlyNotPixelIdenticalDimensions.enabled = this.isSmoothing;
281 mineap 487 if(this.playerController != null){
282     this.playerController.setVideoSmoothing(this.isSmoothing);
283     }
284     }
285    
286 mineap 529 public function checkBoxSmoothingOnlyNotPixelIdenticalDimensionsChanged(event:Event):void
287     {
288     this.isSmoothingOnlyNotPixelIdenticalDimensions = checkBox_isSmoothingOnlyNotPixelIdenticalDimensions.selected;
289     if (this.playerController != null)
290     {
291     this.playerController.setVideoSmoothing(this.isSmoothing);
292     }
293     }
294    
295 mineap 370 private function checkBoxPlayerAlwaysFrontChanged(event:Event):void{
296     this.videoPlayer.isAlwaysFront = (event.currentTarget as CheckBox).selected;
297     this.videoPlayer.alwaysInFront = (event.currentTarget as CheckBox).selected;
298     }
299    
300     private function checkBoxInfoViewAlwaysFrontChanged(event:Event):void{
301     this.isInfoViewAlwaysFront = (event.currentTarget as CheckBox).selected;
302     this.alwaysInFront = (event.currentTarget as CheckBox).selected;
303     }
304    
305     private function checkBoxCommentFontBoldChanged(event:Event):void{
306     this.isCommentFontBold = this.checkBox_commentBold.selected;
307     playerController.setCommentFontBold(this.isCommentFontBold);
308     }
309    
310     private function checkboxSyncCommentChanged():void{
311     this.isSyncComment = this.checkbox_SyncComment.selected;
312     this.commentListProvider.sort = new Sort();
313     this.commentListProvider.sort.fields = [new SortField("vpos_column",true)];
314     this.commentListProvider.refresh();
315     }
316    
317     private function checkboxRepeatAllChanged():void{
318     this.isPlayListRepeat = this.checkBox_repeatAll.selected;
319     if(isPlayListRepeat){
320     videoPlayer.setIsRepeat(false);
321     }
322     }
323    
324     private function checkboxPlayerFollowChanged(event:Event):void{
325     this.isPlayerFollow = this.checkbox_playerFollow.selected;
326     if((event.currentTarget as CheckBox).selected){
327     this.videoPlayer.followInfoView(this.videoPlayer.lastRect);
328     }
329     }
330    
331 mineap 526 private function checkboxFollowInfoViewHeight(event:Event):void
332     {
333     this.isFollowInfoViewHeight = this.checkbox_followInfoViewHeight.selected;
334     if ((event.currentTarget as CheckBox).selected)
335     {
336     this.videoPlayer.resizeInfoView();
337     }
338     }
339    
340 mineap 370 private function checkboxHideUnderControllerChanged(event:Event):void{
341     this.isHideUnderController = this.checkbox_hideUnderController.selected;
342     if(this.videoPlayer.stage.displayState != StageDisplayState.FULL_SCREEN_INTERACTIVE){
343     if((event.currentTarget as CheckBox).selected){
344     //������������������������������
345     this.videoPlayer.showUnderController(false, true);
346     }else{
347     //������������������������������
348     this.videoPlayer.showUnderController(true, true);
349     }
350     }
351     this.videoPlayer.videoController.resetAlpha(true);
352     }
353    
354     private function checkboxHideTagAreaChanged(event:Event):void{
355     this.isHideTagArea = this.checkbox_hideTagArea.selected;
356     if(this.videoPlayer.stage.displayState != StageDisplayState.FULL_SCREEN_INTERACTIVE){
357     if((event.currentTarget as CheckBox).selected){
358     //���������������������������
359     this.videoPlayer.showTagArea(false, true);
360     }else{
361     //������������������������������������
362     this.videoPlayer.showTagArea(true, true);
363     }
364     }
365     this.videoPlayer.videoController.resetAlpha(true);
366     }
367    
368     public function changeWideMode():void{
369     if(isResizePlayerEachPlay){
370     if(this.selectedResizeType == VideoInfoView.RESIZE_TYPE_NICO){
371     isEnableWideMode = !isEnableWideMode;
372     if(checkbox_enableWideMode != null){
373     checkbox_enableWideMode.selected = isEnableWideMode;
374     }
375     this.playerController.resizePlayerJustVideoSize(this.videoPlayer.nowRatio);
376     }
377     }
378     }
379    
380     private function checkboxResizePlayerEachPlay(event:Event):void{
381     this.isResizePlayerEachPlay = this.checkbox_resizePlayerEachPlay.selected;
382     radioGroup_resizeType.selectedValue = selectedResizeType;
383     if(this.isResizePlayerEachPlay){
384     this.playerController.resizePlayerJustVideoSize(this.videoPlayer.nowRatio);
385     this.radioButton_resizeNicoDou.enabled = true;
386     this.radioButton_resizeVideo.enabled = true;
387     if(this.selectedResizeType == VideoInfoView.RESIZE_TYPE_NICO){
388     this.checkbox_enableWideMode.enabled = true;
389     }else{
390     this.checkbox_enableWideMode.enabled = false;
391     }
392     }else{
393     this.videoPlayer.nowRatio = -1;
394     this.radioButton_resizeNicoDou.enabled = false;
395     this.radioButton_resizeVideo.enabled = false;
396     this.checkbox_enableWideMode.enabled = false;
397     }
398    
399     }
400    
401     private function checkBoxAlwaysEconomyChanged(event:Event):void{
402     isAlwaysEconomyForStreaming = this.checkBox_isAlwaysEconomyForStreaming.selected;
403     }
404    
405    
406     private function checkBoxShowAlwaysNicowariAreaChanged(event:Event):void{
407     isShowAlwaysNicowariArea = this.checkBox_showAlwaysNicowariArea.selected;
408     videoPlayer.setShowAlwaysNicowariArea(isShowAlwaysNicowariArea);
409     }
410    
411 mineap 605 private function checkBoxIsNotPlayNicowariChanged(event:Event):void
412     {
413     this.isNotPlayNicowari = this.checkBox_isNotPlayNicowari.selected;
414    
415     if (isNotPlayNicowari)
416     {
417     playerController.stopNicowari();
418     videoPlayer.hideNicowariArea();
419     }
420     else if (isShowAlwaysNicowariArea)
421     {
422     videoPlayer.showNicowariArea();
423     }
424     }
425    
426 mineap 370 public function setShowAlwaysNicowariArea(isShow:Boolean):void{
427     if(this.checkBox_showAlwaysNicowariArea != null){
428     this.checkBox_showAlwaysNicowariArea.selected = isShow;
429     }
430     isShowAlwaysNicowariArea = isShow;
431     }
432    
433     private function checkBoxRenewCommentChanged():void{
434     isRenewCommentEachPlay = checkBox_renewComment.selected;
435     checkBox_renewTagAndNicowari.enabled = isRenewCommentEachPlay;
436     checkBox_isAppendComment.enabled = isRenewCommentEachPlay;
437     }
438    
439     private function checkBoxCommentBoldChanged(event:Event):void{
440     this.isCommentFontBold = checkBox_commentBold.selected;
441     playerController.setCommentFontBold(this.isCommentFontBold);
442     }
443    
444     public function setRelationComboboxEnable(enabled:Boolean):void{
445     if(combobox_relationSort != null){
446     (combobox_relationSort as ComboBox).enabled = enabled;
447     }
448     if(combobox_relationOrder != null){
449     (combobox_relationOrder as ComboBox).enabled = enabled;
450     }
451     }
452    
453     private function thumbPress(event:SliderEvent):void{
454     this.playerController.sliderChanging = true;
455     }
456    
457     private function thumbRelease(event:SliderEvent):void{
458     this.playerController.sliderChanging = false;
459     this.playerController.seek(event.value);
460     }
461    
462     private function sliderVolumeChanged(evt:SliderEvent):void{
463     this.playerController.setVolume(evt.value);
464     }
465    
466     private function sliderFpsChanged(event:SliderEvent):void{
467     this.fps = getFps(event.value);
468     this.playerController.changeFps(this.fps);
469     }
470    
471 mineap 507
472     private function commentCountNumStepperChanged(event:NumericStepperEvent):void
473     {
474     this.showCommentCountPerMin = event.value;
475 mineap 370 }
476    
477 mineap 507 private function ownerCommentCountNumStepperChanged(event:NumericStepperEvent):void
478     {
479     this.showOwnerCommentCountPerMin = event.value;
480     }
481    
482 mineap 370 private function addNGListIdButtonClicked():void{
483     var index:int = -1;
484     if(tabNavigator_comment.selectedIndex == 0){
485     index = this.dataGrid_comment.selectedIndex;
486     }else if(tabNavigator_comment.selectedIndex == 1){
487     index = this.dataGrid_oldComment.selectedIndex;
488     }
489     if(index > -1){
490     this.playerController.ngListManager.addNgID(commentListProvider.getItemAt(index).user_id_column);
491     }
492     }
493    
494     private function addNGListWordButtonClicked():void{
495     var index:int = -1;
496     if(tabNavigator_comment.selectedIndex == 0){
497     index = this.dataGrid_comment.selectedIndex;
498     }else if(tabNavigator_comment.selectedIndex == 1){
499     index = this.dataGrid_oldComment.selectedIndex;
500     }
501     if(index > -1){
502     this.playerController.ngListManager.addNgWord(commentListProvider.getItemAt(index).comment_column);
503     }
504     }
505    
506     private function addPermissionIdButtonClicked():void{
507     var index:int = -1;
508     if(tabNavigator_comment.selectedIndex == 0){
509     index = this.dataGrid_comment.selectedIndex;
510     }else if(tabNavigator_comment.selectedIndex == 1){
511     index = this.dataGrid_oldComment.selectedIndex;
512     }
513     if(index > -1){
514     this.playerController.ngListManager.addPermissionId(commentListProvider.getItemAt(index).user_id_column);
515     }
516     }
517    
518     private function headerReleaseHandler(event:DataGridEvent):void{
519     if(event.columnIndex == 1){
520     this.isSyncComment = false;
521     this.checkbox_SyncComment.selected = false;
522     }
523     }
524    
525     /**
526     * TextInput������������������������ID���NG���������������������������
527     *
528     */
529     private function addItemToNgList():void{
530     playerController.ngListManager.addItemToNgList(textInput_ng.text, combobox_ngKind.selectedLabel);
531     }
532    
533     private function ngListItemClicked(event:ListEvent):void{
534     playerController.ngListManager.ngListItemClicked(event);
535     }
536    
537     /**
538     * ���������������������NG���������NG������������������������������������
539     *
540     */
541     private function removeItemFromNgList():void{
542     playerController.ngListManager.removeItemFromNgList();
543     }
544    
545     private function ngTextInputEnter(event:FlexEvent):void{
546     playerController.ngListManager.addItemToNgList(textInput_ng.text, combobox_ngKind.selectedLabel);
547     }
548    
549     private function fpsDataTipFormatFunction(value:Number):String{
550     return new String(getFps(value));
551     }
552    
553     private function getFps(value:Number):Number{
554     switch(value){
555     case 1:
556     return 7.5;
557     case 2:
558     return 15;
559     case 3:
560     return 30;
561     case 4:
562     return 60;
563     case 5:
564     return 120;
565     default:
566     return 15;
567     }
568     }
569    
570     private function getValueByFps(fps:Number):int{
571     switch(fps){
572     case 7.5:
573     return 1;
574     case 15:
575     return 2;
576     case 30:
577     return 3;
578     case 60:
579     return 4;
580     case 120:
581     return 5;
582     default:
583     return 2;
584     }
585     }
586    
587     private function keyListener(event:KeyboardEvent):void{
588     if(event.keyCode == Keyboard.ESCAPE){
589     }else if(event.keyCode == Keyboard.F11 || (event.keyCode == Keyboard.F && (event.controlKey || event.commandKey))){
590     // trace("Ctrl + " + event.keyCode);
591     this.videoPlayer.changeFull();
592     }else if(event.keyCode == Keyboard.C){
593     // trace(event.keyCode);
594     this.stage.nativeWindow.activate();
595     }else if(event.keyCode == Keyboard.SPACE){
596     this.playerController.play();
597     }else if(event.keyCode == Keyboard.LEFT){
598     //���
599     if(seekTimer != null){
600     seekTimer.stop();
601     }
602     seekTimer = new Timer(100, 1);
603     seekTimer.addEventListener(TimerEvent.TIMER_COMPLETE, function(event:Event):void{
604     var newValue:Number = videoPlayer.videoController.slider_timeline.value + seekValue;
605     if(newValue <= (videoPlayer.videoController.slider_timeline as HSlider).minimum){
606     newValue = 0;
607     }else if(newValue >= (videoPlayer.videoController.slider_timeline as HSlider).maximum){
608     newValue = (videoPlayer.videoController.slider_timeline as HSlider).maximum;
609     }
610     trace(newValue +" = "+videoPlayer.videoController.slider_timeline.value +"+"+ seekValue);
611     playerController.seek(newValue);
612     seekValue = 0;
613     });
614     seekTimer.start();
615     this.seekValue -= 10;
616     }else if(event.keyCode == Keyboard.RIGHT){
617     //���
618     if(seekTimer != null){
619     seekTimer.stop();
620     }
621     seekTimer = new Timer(100, 1);
622     seekTimer.addEventListener(TimerEvent.TIMER_COMPLETE, function(event:Event):void{
623     var newValue:Number = videoPlayer.videoController.slider_timeline.value + seekValue;
624     if(newValue <= (videoPlayer.videoController.slider_timeline as HSlider).minimum){
625     newValue = 0;
626     }else if(newValue >= (videoPlayer.videoController.slider_timeline as HSlider).maximum){
627     newValue = (videoPlayer.videoController.slider_timeline as HSlider).maximum;
628     }
629     trace(newValue +" = "+videoPlayer.videoController.slider_timeline.value +"+"+ seekValue);
630     playerController.seek(newValue);
631     seekValue = 0;
632     });
633     seekTimer.start();
634     this.seekValue += 10;
635     }else if(event.keyCode == Keyboard.UP){
636     this.playerController.setVolume(this.videoPlayer.videoController.slider_volume.value + 0.05);
637     }else if(event.keyCode == Keyboard.DOWN){
638     this.playerController.setVolume(this.videoPlayer.videoController.slider_volume.value - 0.05);
639     }
640     }
641    
642     private function radioButtonResizeTypeChanged(event:Event):void{
643     this.selectedResizeType = int(RadioButton(event.currentTarget).value);
644    
645     if(this.selectedResizeType == VideoInfoView.RESIZE_TYPE_NICO){
646     this.checkbox_enableWideMode.enabled = true;
647 mineap 807 this.checkbox_useOldVersionVideoSize.enabled = true;
648 mineap 370 }else{
649     this.checkbox_enableWideMode.enabled = false;
650 mineap 807 this.checkbox_useOldVersionVideoSize.enabled = false;
651 mineap 370 }
652    
653     this.playerController.resizePlayerJustVideoSize(this.videoPlayer.nowRatio);
654     }
655    
656     private function checkboxEnableWideModeChanged(event:Event):void{
657     this.isEnableWideMode = event.target.selected;
658     this.playerController.resizePlayerJustVideoSize(this.videoPlayer.nowRatio);
659     }
660    
661 mineap 799 private function checkboxUseOldVersionVideoSizeChanged(event:Event):void
662     {
663     this.useOldVersionVideoSize = event.target.selected;
664     this.playerController.isUseOldVersionVideoSize(this.useOldVersionVideoSize);
665     this.playerController.resizePlayerJustVideoSize(this.videoPlayer.nowRatio);
666     }
667    
668 mineap 370 private function checkBox_repeatAllCompleteHandler(event:FlexEvent):void{
669     checkBox_repeatAll.selected = isPlayListRepeat;
670     }
671    
672     private function checkBoxIsSOPCChanged(event:MouseEvent):void{
673     isShowOnlyPermissionComment = checkBox_isShowOnlyPermissionComment.selected;
674     if(this.playerController != null){
675     this.playerController.reloadLocalComment();
676     }
677     }
678    
679     private function checkBoxRenewTagNicowariChanged():void{
680     isRenewOtherCommentWithCommentEachPlay = checkBox_renewTagAndNicowari.selected;
681     }
682    
683     private function checkBoxIsEnableJump(event:MouseEvent):void{
684     isEnableJump = event.currentTarget.selected;
685     (checkBox_askToUserOnJump as CheckBox).enabled = isEnableJump;
686     }
687    
688     private function checkBoxIsAskToUserOnJump(event:MouseEvent):void{
689     isAskToUserOnJump = event.currentTarget.selected;
690     }
691    
692 mineap 824 private function checkBoxIs184(event:MouseEvent):void
693     {
694     is184 = event.currentTarget.selected;
695     }
696    
697 mineap 860 private function checkBox_useDarkColorChanged(event:MouseEvent):void
698     {
699     this.useDarkColor = event.currentTarget.selected;
700    
701     this.changeColor(useDarkColor);
702    
703     }
704    
705 mineap 370 private function checkBoxHideSekaShinComment(event:MouseEvent):void{
706     isHideSekaShinComment = event.currentTarget.selected;
707    
708     if(this.playerController != null){
709     this.playerController.reloadLocalComment();
710     }
711     }
712    
713     private function commentListDoubleClicked(event:ListEvent):void{
714     var time:String = event.target.selectedItem.vpos_column;
715    
716     var min:int = int(time.substring(0,time.indexOf(":")));
717     var sec:int = int(time.substring(time.indexOf(":")+1));
718    
719     if(playerController.windowType == PlayerController.WINDOW_TYPE_FLV){
720     this.playerController.seek(min*60 + sec);
721     }else{
722     this.playerController.seek((min*60 + sec)*playerController.swfFrameRate);
723     }
724     }
725    
726     private function ichibaDataGridDoubleClicked(event:ListEvent):void{
727     trace((event.currentTarget as DataGrid).dataProvider[event.rowIndex].col_link);
728     var url:String = (event.currentTarget as DataGrid).dataProvider[event.rowIndex].col_link;
729     if(url != null){
730     navigateToURL(new URLRequest(url));
731     }
732     }
733    
734     private function commentScaleSliderChanged(event:SliderEvent):void{
735     this.commentScale = event.value;
736     this.playerController.windowResized(true);
737     }
738    
739     private function sliderShowCommentTimeChanged(event:SliderEvent):void{
740     this.showCommentSec = event.value;
741     }
742    
743     private function sliderCommentAlphaChanged(event:SliderEvent):void{
744     this.commentAlpha = event.value;
745     playerController.getCommentManager().setCommentAlpha(this.commentAlpha/100);
746     }
747    
748     private function myDataTipFormatFunction(value:Number):String{
749     var nowSec:String="00",nowMin:String="0";
750     nowSec = String(int(value%60));
751     nowMin = String(int(value/60));
752    
753     if(nowSec.length == 1){
754     nowSec = "0" + nowSec;
755     }
756     if(nowMin.length == 1){
757     nowMin = "0" + nowMin;
758     }
759     return nowMin + ":" + nowSec;
760     }
761    
762     private function windowCompleteHandler():void{
763    
764     videoPlayer.alwaysInFront = videoPlayer.isAlwaysFront;
765     this.alwaysInFront = this.isInfoViewAlwaysFront;
766    
767     // checkbox_repeat.selected = isRepeat;
768     // checkbox_showComment.selected = isShowComment;
769     checkbox_SyncComment.selected = isSyncComment;
770     checkBox_isShowOnlyPermissionComment.selected = isShowOnlyPermissionComment;
771     checkbox_showHtml.selected = isShowHTMLOwnerComment;
772    
773     videoPlayer.setShowAlwaysNicowariArea(isShowAlwaysNicowariArea);
774     playerController.setCommentFontBold(this.isCommentFontBold);
775    
776     videoPlayer.showUnderController(!isHideUnderController, true);
777     videoPlayer.showTagArea(!isHideTagArea, true);
778    
779     this.setStyle("fontFamily", ConfigManager.getInstance().getItem("fontFamily"));
780 mineap 439 this.setStyle("fontSize", Number(ConfigManager.getInstance().getItem("fontSize")));
781 mineap 370 }
782    
783 mineap 652 private function comboboxRelationOrderCreationCompleteHandler(event:FlexEvent):void
784     {
785 mineap 370 combobox_relationOrder.selectedIndex = relationOrderIndex;
786 mineap 652 }
787    
788     private function comboboxRelationSortCreationCompleteHandler(event:FlexEvent):void
789     {
790 mineap 370 combobox_relationSort.selectedIndex = relationSortIndex;
791     }
792    
793     private function relationSortComboboxChange(event:Event):void{
794     relationSortIndex = combobox_relationSort.selectedIndex;
795     playerController.setNicoRelationInfoForRelationSortTypeChange();
796     }
797    
798     private function relationOrderComboboxChange(event:Event):void{
799     relationOrderIndex = combobox_relationOrder.selectedIndex;
800     playerController.setNicoRelationInfoForRelationSortTypeChange();
801     }
802    
803 mineap 498 private function playerQualitySliderChanged(event:Event):void{
804     playerQuality = slider_playerQuality.value;
805 mineap 370
806 mineap 498 if(playerController != null){
807     playerController.setPlayerQuality(playerQuality);
808     }
809     }
810    
811     private function configCanvas1CreationCompleteHandler(event:FlexEvent):void{
812 mineap 370 checkbox_resizePlayerEachPlay.selected = isResizePlayerEachPlay;
813 mineap 498
814 mineap 370 if(isResizePlayerEachPlay){
815     radioButton_resizeNicoDou.enabled = true;
816     radioButton_resizeVideo.enabled = true;
817     }else{
818     radioButton_resizeNicoDou.enabled = false;
819     radioButton_resizeVideo.enabled = false;
820     }
821    
822 mineap 807 radioGroup_resizeType.selectedValue = selectedResizeType;
823     if (selectedResizeType != 1)
824     {
825     checkbox_useOldVersionVideoSize.enabled = false;
826     checkbox_enableWideMode.enabled = false;
827     }
828 mineap 799 checkbox_useOldVersionVideoSize.selected = useOldVersionVideoSize;
829 mineap 807 checkbox_enableWideMode.selected = isEnableWideMode;
830 mineap 799
831 mineap 498 checkBox_isSmoothing.selected = isSmoothing;
832 mineap 529 checkBox_isSmoothingOnlyNotPixelIdenticalDimensions.enabled = isSmoothing;
833     checkBox_isSmoothingOnlyNotPixelIdenticalDimensions.selected = isSmoothingOnlyNotPixelIdenticalDimensions;
834 mineap 370
835 mineap 498 if(playerController.getCommentManager() != null){
836     playerController.getCommentManager().setAntiAlias(isAntiAlias);
837     }
838    
839     checkBox_isAlwaysEconomyForStreaming.selected = isAlwaysEconomyForStreaming;
840    
841     slider_playerQuality.value = playerQuality;
842    
843     }
844    
845     private function configCanvas2CreationCompleteHandler(event:FlexEvent):void{
846 mineap 370 checkBox_commentBold.selected = isCommentFontBold;
847 mineap 498 checkBox_hideSekaShinComment.selected = isHideSekaShinComment;
848     checkBox_isNgUpEnable.selected = isNgUpEnable;
849 mineap 370
850     slider_commentScale.value = commentScale;
851     slider_fps.value = getValueByFps(fps);
852 mineap 507
853     commentNumStepper.value = showCommentCountPerMin;
854     ownerCommentNumStepper.value = showOwnerCommentCountPerMin;
855    
856 mineap 370 slider_showCommentTime.value = showCommentSec;
857     slider_commentAlpha.value = commentAlpha;
858    
859 mineap 796 var value:String = ConfigManager.getInstance().getItem("isLengthwisePreferred");
860     if (value != null)
861     {
862     var isLengthwisePreferred:Boolean = ConfUtil.parseBoolean(value);
863     checkBox_isLengthwisePreferred.selected = isLengthwisePreferred;
864     }
865 mineap 498 }
866    
867     private function configCanvas3CreationCompleteHandler(event:FlexEvent):void{
868     checkbox_PlayerAlwaysFront.selected = videoPlayer.isAlwaysFront;
869     checkbox_InfoViewAlwaysFront.selected = isInfoViewAlwaysFront;
870 mineap 370
871 mineap 498 checkbox_playerFollow.selected = isPlayerFollow;
872     checkBox_renewComment.selected = isRenewCommentEachPlay;
873     checkBox_renewTagAndNicowari.selected = isRenewOtherCommentWithCommentEachPlay;
874     checkBox_renewTagAndNicowari.enabled = isRenewCommentEachPlay;
875 mineap 370
876 mineap 498 isAppendComment = FlexGlobals.topLevelApplication.getAppendComment();
877 mineap 370 checkBox_isAppendComment.selected = isAppendComment;
878     checkBox_isAppendComment.enabled = isRenewCommentEachPlay;
879    
880 mineap 527 checkbox_followInfoViewHeight.selected = isFollowInfoViewHeight;
881 mineap 370
882 mineap 605 checkBox_isNotPlayNicowari.selected = isNotPlayNicowari;
883 mineap 498 checkBox_showAlwaysNicowariArea.selected = isShowAlwaysNicowariArea;
884     checkbox_hideTagArea.selected = isHideTagArea;
885     checkbox_hideUnderController.selected = isHideUnderController;
886    
887     checkBox_enableJump.selected = isEnableJump;
888     checkBox_askToUserOnJump.selected = isAskToUserOnJump;
889     checkBox_askToUserOnJump.enabled = isEnableJump;
890 mineap 605
891 mineap 824 checkBox_is184.selected = is184;
892 mineap 605
893 mineap 860 checkBox_useDarkColor.selected = useDarkColor;
894    
895 mineap 370 }
896    
897 mineap 498
898 mineap 370 public function isRepeatAll():Boolean{
899     return this.isPlayListRepeat;
900     }
901    
902     private function windowResized(event:NativeWindowBoundsEvent):void{
903     lastRect = event.afterBounds;
904     }
905    
906     private function windowMove(event:NativeWindowBoundsEvent):void{
907     lastRect = event.afterBounds;
908     }
909    
910     public function playListDoubleClicked():void{
911     if(playListProvider.length > 0){
912     var url:String = videoUrlMap[playListProvider[dataGrid_playList.selectedIndex]];
913     playerController.initForVideoPlayer(url, dataGrid_playList.selectedIndex);
914     }
915     }
916    
917     /**
918     * ���������������������������������������������������������������������������������������������������
919     *
920     */
921     public function selectComment(no:Number):void{
922    
923     for(var i:int = 0; i<commentListProvider.length; i++){
924     if(commentListProvider[i].no_column == no){
925     (dataGrid_comment as DataGrid).selectedIndex = i;
926    
927     return;
928     }
929     }
930    
931     }
932    
933     private function readStore():void{
934    
935     try{
936     /*���������������������������������������������*/
937    
938     var confValue:String = null;
939     confValue = ConfigManager.getInstance().getItem("isPlayListRepeat");
940     if (confValue == null) {
941     //���������������
942     }else{
943     isPlayListRepeat = ConfUtil.parseBoolean(confValue);
944     }
945    
946     confValue = ConfigManager.getInstance().getItem("isSyncComment");
947     if (confValue == null) {
948     //���������������
949     }else{
950     isSyncComment = ConfUtil.parseBoolean(confValue);
951     }
952    
953     confValue = ConfigManager.getInstance().getItem("isPlayerFollow");
954     if (confValue == null) {
955     //���������������
956     }else{
957     isPlayerFollow = ConfUtil.parseBoolean(confValue);
958     }
959    
960     confValue = ConfigManager.getInstance().getItem("isRenewCommentEachPlay");
961     if (confValue == null) {
962     //���������������
963     }else{
964     isRenewCommentEachPlay = ConfUtil.parseBoolean(confValue);
965     }
966    
967     confValue = ConfigManager.getInstance().getItem("isResizePlayerEachPlay");
968     if (confValue == null) {
969     //���������������
970     }else{
971     isResizePlayerEachPlay = ConfUtil.parseBoolean(confValue);
972     }
973    
974     confValue = ConfigManager.getInstance().getItem("isHideUnderController");
975     if (confValue == null) {
976     //���������������
977     }else{
978     isHideUnderController = ConfUtil.parseBoolean(confValue);
979     }
980    
981     confValue = ConfigManager.getInstance().getItem("commentScale");
982     if (confValue == null) {
983     //���������������
984     }else{
985     commentScale = Number(confValue);
986     }
987    
988     confValue = ConfigManager.getInstance().getItem("commentFps");
989     if (confValue == null) {
990     //���������������
991     }else{
992     this.fps = Number(confValue);
993     this.playerController.changeFps(this.fps);
994     }
995    
996     confValue = ConfigManager.getInstance().getItem("isShowOnlyPermissionComment");
997     if (confValue == null) {
998     //���������������
999     }else{
1000     isShowOnlyPermissionComment = ConfUtil.parseBoolean(confValue);
1001     }
1002    
1003     confValue = ConfigManager.getInstance().getItem("showCommentCount");
1004     if (confValue == null) {
1005     //���������������
1006     }else{
1007 mineap 507 showCommentCountPerMin = int(confValue);
1008 mineap 370 }
1009    
1010 mineap 507 confValue = ConfigManager.getInstance().getItem("showOwnerCommentCount");
1011     if (confValue == null) {
1012     showOwnerCommentCountPerMin = showCommentCountPerMin;
1013     }else{
1014     showOwnerCommentCountPerMin = int(confValue);
1015     }
1016    
1017 mineap 370 confValue = ConfigManager.getInstance().getItem("showCommentSec");
1018     if (confValue == null) {
1019     //���������������
1020     }else{
1021     showCommentSec = int(confValue);
1022     }
1023    
1024     confValue = ConfigManager.getInstance().getItem("isRenewOtherCommentWithCommentEachPlay");
1025     if (confValue == null) {
1026     //���������������
1027     }else{
1028     isRenewOtherCommentWithCommentEachPlay = ConfUtil.parseBoolean(confValue);
1029     }
1030    
1031     confValue = ConfigManager.getInstance().getItem("isAntiAlias");
1032     if (confValue == null) {
1033     //���������������
1034     }else{
1035     isAntiAlias = ConfUtil.parseBoolean(confValue);
1036     }
1037    
1038     confValue = ConfigManager.getInstance().getItem("commentAlpha");
1039     if (confValue == null) {
1040     //���������������
1041     }else{
1042     commentAlpha = int(confValue);
1043     }
1044    
1045     confValue = ConfigManager.getInstance().getItem("isEnableJump");
1046     if (confValue == null) {
1047     //���������������
1048     }else{
1049     isEnableJump = ConfUtil.parseBoolean(confValue);
1050     }
1051    
1052     confValue = ConfigManager.getInstance().getItem("isAskToUserOnJump");
1053     if (confValue == null) {
1054     //���������������
1055     }else{
1056     isAskToUserOnJump = ConfUtil.parseBoolean(confValue);
1057     }
1058    
1059     confValue = ConfigManager.getInstance().getItem("isInfoViewAlwaysFront");
1060     if (confValue == null) {
1061     //���������������
1062     }else{
1063     isInfoViewAlwaysFront = ConfUtil.parseBoolean(confValue);
1064     }
1065    
1066     confValue = ConfigManager.getInstance().getItem("selectedResizeType");
1067     if (confValue == null) {
1068     //���������������
1069     }else{
1070     selectedResizeType = int(confValue);
1071     }
1072    
1073     confValue = ConfigManager.getInstance().getItem("isCommentFontBold");
1074     if (confValue == null) {
1075     //���������������
1076     }else{
1077     isCommentFontBold = ConfUtil.parseBoolean(confValue);
1078     }
1079    
1080     confValue = ConfigManager.getInstance().getItem("isShowAlwaysNicowariArea");
1081     if (confValue == null) {
1082     //���������������
1083     }else{
1084     isShowAlwaysNicowariArea = ConfUtil.parseBoolean(confValue);
1085     }
1086    
1087     confValue = ConfigManager.getInstance().getItem("isHideTagArea");
1088     if (confValue == null) {
1089     //���������������
1090     }else{
1091     isHideTagArea = ConfUtil.parseBoolean(confValue);
1092     }
1093    
1094     confValue = ConfigManager.getInstance().getItem("isAlwaysEconomyForStreaming");
1095     if (confValue == null) {
1096     //���������������
1097     }else{
1098     isAlwaysEconomyForStreaming = ConfUtil.parseBoolean(confValue);
1099     }
1100    
1101     confValue = ConfigManager.getInstance().getItem("isAppendComment");
1102     if (confValue == null) {
1103     //���������������
1104     }else{
1105     isAppendComment = ConfUtil.parseBoolean(confValue);
1106     }
1107    
1108     confValue = ConfigManager.getInstance().getItem("isHideSekaShinComment");
1109     if (confValue == null) {
1110     //���������������
1111     }else{
1112     isHideSekaShinComment = ConfUtil.parseBoolean(confValue);
1113     }
1114    
1115     confValue = ConfigManager.getInstance().getItem("isShowHTMLOwnerComment");
1116     if (confValue == null) {
1117     //���������������
1118     }else{
1119     isShowHTMLOwnerComment = ConfUtil.parseBoolean(confValue);
1120     }
1121    
1122     //x,y,w,h
1123     confValue = ConfigManager.getInstance().getItem("controllerWindowPosition_x");
1124     var controllerPosition_x:Number = 0;
1125     if (confValue == null) {
1126     //���������������
1127     }else{
1128     controllerPosition_x = Number(confValue);
1129     this.addEventListener(FlexEvent.CREATION_COMPLETE, function():void{
1130     nativeWindow.x = lastRect.x = controllerPosition_x;
1131     });
1132     }
1133    
1134     confValue = ConfigManager.getInstance().getItem("controllerWindowPosition_y");
1135     var controllerPosition_y:Number = 0;
1136     if (confValue == null) {
1137     //���������������
1138     }else{
1139     controllerPosition_y = Number(confValue);
1140     this.addEventListener(FlexEvent.CREATION_COMPLETE, function():void{
1141     nativeWindow.y = lastRect.y = controllerPosition_y;
1142     });
1143     }
1144    
1145     confValue = ConfigManager.getInstance().getItem("controllerWindowPosition_w");
1146     var controllerPosition_w:Number = 380;
1147     if (confValue == null) {
1148     //���������������
1149     }else{
1150     controllerPosition_w = Number(confValue);
1151     this.addEventListener(FlexEvent.CREATION_COMPLETE, function():void{
1152     nativeWindow.width = lastRect.width = controllerPosition_w;
1153     });
1154     }
1155    
1156     confValue = ConfigManager.getInstance().getItem("controllerWindowPosition_h");
1157     var controllerPosition_h:Number = 520;
1158     if (confValue == null) {
1159     //���������������
1160     }else{
1161     controllerPosition_h = Number(confValue);
1162     this.addEventListener(FlexEvent.CREATION_COMPLETE, function():void{
1163     nativeWindow.height = lastRect.height = controllerPosition_h;
1164     });
1165     }
1166    
1167     confValue = ConfigManager.getInstance().getItem("isEnableWideMode");
1168     if(confValue == null){
1169     //���������������
1170     isEnableWideMode = true;
1171     }else{
1172     isEnableWideMode = ConfUtil.parseBoolean(confValue);
1173     }
1174    
1175 mineap 799 confValue = ConfigManager.getInstance().getItem("useOldVersionVideoSize");
1176     if (confValue == null)
1177     {
1178     useOldVersionVideoSize = false;
1179     }else
1180     {
1181     useOldVersionVideoSize = ConfUtil.parseBoolean(confValue);
1182     }
1183 mineap 817 playerController.isUseOldVersionVideoSize(useOldVersionVideoSize);
1184 mineap 799
1185    
1186 mineap 370 confValue = ConfigManager.getInstance().getItem("relationSortIndex");
1187     if(confValue == null){
1188     //���������������
1189     }else{
1190     relationSortIndex = int(confValue);
1191     }
1192    
1193     confValue = ConfigManager.getInstance().getItem("relationOrderIndex");
1194     if(confValue == null){
1195     //���������������
1196     }else{
1197     relationOrderIndex = int(confValue);
1198     }
1199    
1200     confValue = ConfigManager.getInstance().getItem("isNgUpEnable");
1201     if(confValue == null){
1202     // ���������������
1203     }else{
1204     isNgUpEnable = ConfUtil.parseBoolean(confValue);
1205     }
1206    
1207 mineap 487 confValue = ConfigManager.getInstance().getItem("isSmoothing");
1208     if(confValue != null){
1209     isSmoothing = ConfUtil.parseBoolean(confValue);
1210     }
1211     if(playerController != null){
1212     playerController.setVideoSmoothing(this.isSmoothing);
1213     }
1214 mineap 439
1215 mineap 529 confValue = ConfigManager.getInstance().getItem("isSmoothingOnlyNotPixelIdenticalDimensions");
1216     if(confValue != null){
1217     isSmoothingOnlyNotPixelIdenticalDimensions = ConfUtil.parseBoolean(confValue);
1218     }
1219    
1220 mineap 498 confValue = ConfigManager.getInstance().getItem("playerQuality");
1221     if(confValue != null){
1222     playerQuality = int(confValue);
1223     }
1224     if(playerController != null){
1225     playerController.setPlayerQuality(this.playerQuality);
1226     }
1227 mineap 487
1228 mineap 498 confValue = ConfigManager.getInstance().getItem("isEnableWideMode");
1229     if(confValue != null){
1230     isEnableWideMode = ConfUtil.parseBoolean(confValue);
1231     }
1232    
1233 mineap 526 confValue = ConfigManager.getInstance().getItem("isFollowInfoViewHeight");
1234     if (confValue != null)
1235     {
1236     isFollowInfoViewHeight = ConfUtil.parseBoolean(confValue);
1237     }
1238    
1239 mineap 605 confValue = ConfigManager.getInstance().getItem("isNotPlayNicowari");
1240     if (confValue != null)
1241     {
1242     isNotPlayNicowari = ConfUtil.parseBoolean(confValue);
1243     }
1244    
1245 mineap 711 confValue = ConfigManager.getInstance().getItem("isOpenFileDialogWhenOpenPlayer");
1246     if (confValue != null)
1247     {
1248     this.isOpenFileDialogWhenOpenPlayer = ConfUtil.parseBoolean(confValue);
1249     }
1250    
1251 mineap 824 confValue = ConfigManager.getInstance().getItem("is184");
1252     if (confValue != null)
1253     {
1254     this.is184 = ConfUtil.parseBoolean(confValue);
1255     }
1256    
1257 mineap 860 confValue = ConfigManager.getInstance().getItem("useDarkColor");
1258     if (confValue != null)
1259     {
1260     this.useDarkColor = ConfUtil.parseBoolean(confValue);
1261     }
1262    
1263 mineap 869 confValue = ConfigManager.getInstance().getItem("ownerCommentTextSize");
1264     if (confValue != null)
1265     {
1266     var height:int = int(confValue);
1267    
1268     if (height >= 0) {
1269     this.ownerCommentTextSize = height;
1270     }
1271     }
1272    
1273 mineap 370 }catch(error:Error){
1274     trace(error.getStackTrace());
1275     Alert.show(Message.M_CONF_FILE_IS_BROKEN, Message.M_ERROR);
1276     logManager.addLog(Message.FAIL_LOAD_CONF_FILE_FOR_VIDEO_INFO_VIEW + ":" + Message.M_CONF_FILE_IS_BROKEN + ":" + ConfigManager.getInstance().confFileNativePath + ":" + error);
1277     }
1278    
1279     }
1280    
1281     public function saveStore():void{
1282    
1283     try{
1284    
1285     trace("saveStore_videoInfoView");
1286    
1287     /*������������������������������������*/
1288     ConfigManager.getInstance().removeItem("isPlayListRepeat");
1289     ConfigManager.getInstance().setItem("isPlayListRepeat", isPlayListRepeat);
1290    
1291     ConfigManager.getInstance().removeItem("isSyncComment");
1292     ConfigManager.getInstance().setItem("isSyncComment", isSyncComment);
1293    
1294     ConfigManager.getInstance().removeItem("isPlayerFollow");
1295     ConfigManager.getInstance().setItem("isPlayerFollow", isPlayerFollow);
1296    
1297     ConfigManager.getInstance().removeItem("isRenewCommentEachPlay");
1298     ConfigManager.getInstance().setItem("isRenewCommentEachPlay", isRenewCommentEachPlay);
1299    
1300     ConfigManager.getInstance().removeItem("isResizePlayerEachPlay");
1301     ConfigManager.getInstance().setItem("isResizePlayerEachPlay", isResizePlayerEachPlay);
1302    
1303     ConfigManager.getInstance().removeItem("isHideUnderController");
1304     ConfigManager.getInstance().setItem("isHideUnderController", isHideUnderController);
1305    
1306     // ������������������������������������
1307     ConfigManager.getInstance().removeItem("controllerWindowPosition_x");
1308     ConfigManager.getInstance().setItem("controllerWindowPosition_x", lastRect.x);
1309    
1310     ConfigManager.getInstance().removeItem("controllerWindowPosition_y");
1311     ConfigManager.getInstance().setItem("controllerWindowPosition_y", lastRect.y);
1312    
1313     ConfigManager.getInstance().removeItem("controllerWindowPosition_w");
1314     ConfigManager.getInstance().setItem("controllerWindowPosition_w", lastRect.width);
1315    
1316     ConfigManager.getInstance().removeItem("controllerWindowPosition_h");
1317     ConfigManager.getInstance().setItem("controllerWindowPosition_h", lastRect.height);
1318    
1319     ConfigManager.getInstance().removeItem("commentScale");
1320     ConfigManager.getInstance().setItem("commentScale", commentScale);
1321    
1322     ConfigManager.getInstance().removeItem("commentFps");
1323     ConfigManager.getInstance().setItem("commentFps", fps);
1324    
1325     ConfigManager.getInstance().removeItem("isShowOnlyPermissionComment");
1326     ConfigManager.getInstance().setItem("isShowOnlyPermissionComment", isShowOnlyPermissionComment);
1327    
1328     ConfigManager.getInstance().removeItem("showCommentCount");
1329 mineap 507 ConfigManager.getInstance().setItem("showCommentCount", showCommentCountPerMin);
1330 mineap 370
1331 mineap 507 ConfigManager.getInstance().removeItem("showOwnerCommentCount");
1332     ConfigManager.getInstance().setItem("showOwnerCommentCount", showOwnerCommentCountPerMin);
1333    
1334 mineap 370 ConfigManager.getInstance().removeItem("showCommentSec");
1335     ConfigManager.getInstance().setItem("showCommentSec", showCommentSec);
1336    
1337     ConfigManager.getInstance().removeItem("isRenewOtherCommentWithCommentEachPlay");
1338     ConfigManager.getInstance().setItem("isRenewOtherCommentWithCommentEachPlay", isRenewOtherCommentWithCommentEachPlay);
1339    
1340     ConfigManager.getInstance().removeItem("isAntiAlias");
1341     ConfigManager.getInstance().setItem("isAntiAlias", isAntiAlias);
1342    
1343     ConfigManager.getInstance().removeItem("commentAlpha");
1344     ConfigManager.getInstance().setItem("commentAlpha", commentAlpha);
1345    
1346     ConfigManager.getInstance().removeItem("isEnableJump");
1347     ConfigManager.getInstance().setItem("isEnableJump", isEnableJump);
1348    
1349     ConfigManager.getInstance().removeItem("isAskToUserOnJump");
1350     ConfigManager.getInstance().setItem("isAskToUserOnJump", isAskToUserOnJump);
1351    
1352     ConfigManager.getInstance().removeItem("isInfoViewAlwaysFront");
1353     ConfigManager.getInstance().setItem("isInfoViewAlwaysFront", isInfoViewAlwaysFront);
1354    
1355     ConfigManager.getInstance().removeItem("selectedResizeType");
1356     ConfigManager.getInstance().setItem("selectedResizeType", selectedResizeType);
1357    
1358     ConfigManager.getInstance().removeItem("isCommentFontBold");
1359     ConfigManager.getInstance().setItem("isCommentFontBold", isCommentFontBold);
1360    
1361     ConfigManager.getInstance().removeItem("isShowAlwaysNicowariArea");
1362     ConfigManager.getInstance().setItem("isShowAlwaysNicowariArea", isShowAlwaysNicowariArea);
1363    
1364     ConfigManager.getInstance().removeItem("isAlwaysEconomyForStreaming");
1365     ConfigManager.getInstance().setItem("isAlwaysEconomyForStreaming", isAlwaysEconomyForStreaming);
1366    
1367     ConfigManager.getInstance().removeItem("isHideTagArea");
1368     ConfigManager.getInstance().setItem("isHideTagArea", isHideTagArea);
1369    
1370     ConfigManager.getInstance().removeItem("isAppendComment");
1371     ConfigManager.getInstance().setItem("isAppendComment", isAppendComment);
1372    
1373     ConfigManager.getInstance().removeItem("isHideSekaShinComment");
1374     ConfigManager.getInstance().setItem("isHideSekaShinComment", isHideSekaShinComment);
1375    
1376     ConfigManager.getInstance().removeItem("isShowHTMLOwnerComment");
1377     ConfigManager.getInstance().setItem("isShowHTMLOwnerComment", isShowHTMLOwnerComment);
1378    
1379     ConfigManager.getInstance().removeItem("relationSortIndex");
1380     ConfigManager.getInstance().setItem("relationSortIndex", relationSortIndex);
1381    
1382     ConfigManager.getInstance().removeItem("relationOrderIndex");
1383     ConfigManager.getInstance().setItem("relationSortIndex", relationSortIndex);
1384    
1385     ConfigManager.getInstance().removeItem("isNgUpEnable");
1386     ConfigManager.getInstance().setItem("isNgUpEnable", isNgUpEnable);
1387    
1388 mineap 487 ConfigManager.getInstance().removeItem("isSmoothing");
1389     ConfigManager.getInstance().setItem("isSmoothing",isSmoothing);
1390    
1391 mineap 529 ConfigManager.getInstance().removeItem("isSmoothingOnlyNotPixelIdenticalDimensions");
1392     ConfigManager.getInstance().setItem("isSmoothingOnlyNotPixelIdenticalDimensions", isSmoothingOnlyNotPixelIdenticalDimensions);
1393    
1394 mineap 498 ConfigManager.getInstance().removeItem("playerQuality");
1395     ConfigManager.getInstance().setItem("playerQuality", playerQuality);
1396    
1397     ConfigManager.getInstance().removeItem("isEnableWideMode");
1398     ConfigManager.getInstance().setItem("isEnableWideMode", isEnableWideMode);
1399    
1400 mineap 799 ConfigManager.getInstance().removeItem("useOldVersionVideoSize");
1401     ConfigManager.getInstance().setItem("useOldVersionVideoSize", useOldVersionVideoSize);
1402    
1403 mineap 526 ConfigManager.getInstance().removeItem("isFollowInfoViewHeight");
1404     ConfigManager.getInstance().setItem("isFollowInfoViewHeight", isFollowInfoViewHeight);
1405    
1406 mineap 605 ConfigManager.getInstance().removeItem("isNotPlayNicowari");
1407     ConfigManager.getInstance().setItem("isNotPlayNicowari", isNotPlayNicowari);
1408    
1409 mineap 628
1410     /* DataGrid��������������� */
1411     if (dataGrid_comment != null)
1412     {
1413     DataGridColumnWidthUtil.save(dataGrid_comment, new Vector.<String>("mail_column"));
1414     }
1415    
1416     if (dataGrid_oldComment != null)
1417     {
1418     DataGridColumnWidthUtil.save(dataGrid_oldComment, new Vector.<String>("mail_column"));
1419     }
1420    
1421 mineap 711 ConfigManager.getInstance().removeItem("isOpenFileDialogWhenOpenPlayer");
1422     ConfigManager.getInstance().setItem("isOpenFileDialogWhenOpenPlayer", isOpenFileDialogWhenOpenPlayer);
1423 mineap 628
1424 mineap 824 ConfigManager.getInstance().removeItem("is184");
1425     ConfigManager.getInstance().setItem("is184", is184);
1426    
1427 mineap 860 ConfigManager.getInstance().removeItem("useDarkColor");
1428     ConfigManager.getInstance().setItem("useDarkColor", useDarkColor);
1429    
1430 mineap 869 ConfigManager.getInstance().removeItem("ownerCommentTextSize");
1431     ConfigManager.getInstance().setItem("ownerCommentTextSize", ownerCommentTextSize);
1432    
1433 mineap 370 ConfigManager.getInstance().save();
1434    
1435     }catch(error:Error){
1436     Alert.show(Message.M_CONF_FILE_IS_BROKEN, Message.M_ERROR);
1437     logManager.addLog(Message.FAIL_SAVE_CONF_FILE_FOR_VIDEO_INFO_VIEW + ":" + Message.M_CONF_FILE_IS_BROKEN + ":" + ConfigManager.getInstance().confFileNativePath + ":" + error);
1438     trace(error.getStackTrace());
1439     }
1440    
1441     }
1442    
1443     public function resetWindowPosition():void{
1444     // ������������������������������������
1445     try{
1446    
1447     // ������������������������������������������������������������
1448     ConfigManager.getInstance().removeItem("controllerWindowPosition_x");
1449     ConfigManager.getInstance().setItem("controllerWindowPosition_x", 0);
1450    
1451     ConfigManager.getInstance().removeItem("controllerWindowPosition_y");
1452     ConfigManager.getInstance().setItem("controllerWindowPosition_y", 0);
1453    
1454     ConfigManager.getInstance().removeItem("controllerWindowPosition_w");
1455     ConfigManager.getInstance().setItem("controllerWindowPosition_w", 400);
1456    
1457     ConfigManager.getInstance().removeItem("controllerWindowPosition_h");
1458     ConfigManager.getInstance().setItem("controllerWindowPosition_h", 580);
1459    
1460     ConfigManager.getInstance().save();
1461    
1462     this.readStore();
1463    
1464     }catch(error:Error){
1465     Alert.show(Message.M_CONF_FILE_IS_BROKEN, Message.M_ERROR);
1466     logManager.addLog(Message.FAIL_SAVE_CONF_FILE_FOR_VIDEO_INFO_VIEW + ":" + Message.M_CONF_FILE_IS_BROKEN + ":" + ConfigManager.getInstance().confFileNativePath + ":" + error);
1467     trace(error.getStackTrace());
1468     }
1469    
1470     if(this.nativeWindow != null && !(this as Window).closed){
1471    
1472     this.visible = true;
1473    
1474     this.nativeWindow.x = 0;
1475     this.nativeWindow.y = 0;
1476    
1477     this.width = 380;
1478     this.height = 520;
1479     }
1480     }
1481    
1482     /**
1483     *
1484     * @param urlList
1485     * @param videoNameList
1486     * @param playListName
1487     */
1488     public function setPlayList(urlList:Array, videoNameList:Array, playListName:String):void{
1489    
1490     this.playListName = playListName;
1491     label_playListTitle_dataProvider = playListName;
1492    
1493     for each(var title:String in videoNameList){
1494     playListProvider.addItem(title);
1495     }
1496    
1497     for(var index:int = 0; index<urlList.length; index++){
1498     videoUrlMap[videoNameList[index]] = urlList[index];
1499     }
1500    
1501     if(this.dataGrid_playList != null){
1502     // (dataGrid_playList as DataGrid).validateDisplayList();
1503     }
1504     }
1505    
1506     /**
1507     *
1508     * @param url
1509     * @param title
1510     *
1511     */
1512     public function addPlayListItem(url:String, title:String):void{
1513    
1514     videoUrlMap[title] = url;
1515    
1516     }
1517    
1518     /**
1519     *
1520     * @param url
1521     * @param title
1522     * @param index
1523     *
1524     */
1525     public function addPlayListItemWithList(url:String, title:String, index:int):void{
1526     playListProvider.addItemAt(title,index);
1527    
1528     addPlayListItem(url, title);
1529    
1530     if(this.dataGrid_playList != null){
1531     (dataGrid_playList as DataGrid).dataProvider = playListProvider;
1532     (dataGrid_playList as DataGrid).validateDisplayList();
1533     }
1534    
1535     }
1536    
1537    
1538     /**
1539     *
1540     * @param title
1541     * @param index
1542     *
1543     */
1544     public function removePlayListItem(index:int):void{
1545     var title:String = String(playListProvider.removeItemAt(index));
1546    
1547     //���������������������������������������������������������������
1548     for each(var videoName:String in playListProvider){
1549     if(title == videoName){
1550     //������������������videoUrlMap���������������������
1551     return;
1552     }
1553     }
1554     //���������������������videoUrlMap������������
1555     videoUrlMap[title] = null;
1556    
1557     if(this.dataGrid_playList != null){
1558     (dataGrid_playList as DataGrid).dataProvider = playListProvider;
1559     (dataGrid_playList as DataGrid).validateDisplayList();
1560     }
1561     }
1562    
1563     /**
1564     *
1565     * @return
1566     *
1567     */
1568     public function getPlayList():Array{
1569     var array:Array = new Array();
1570     for(var i:int = 0; i<playListProvider.length; i++){
1571     array.push(String(playListProvider[i]));
1572     }
1573    
1574     var returnArray:Array = new Array();
1575    
1576     for each(var title:String in array){
1577     returnArray.push(videoUrlMap[title]);
1578     }
1579    
1580     return returnArray;
1581     }
1582    
1583     /**
1584     * ���������������������������������������������������������������
1585     * @return
1586     *
1587     */
1588     public function getNameList():Array{
1589     var array:Array = new Array();
1590     for(var i:int = 0; i<playListProvider.length; i++){
1591     array.push(String(playListProvider[i]));
1592     }
1593    
1594     return array;
1595     }
1596    
1597     /**
1598     *
1599     *
1600     */
1601     public function resetPlayList():void{
1602     this.playListName = "";
1603     if(label_playListTitle != null){
1604     label_playListTitle.text = playListName;
1605     }else{
1606     canvas_videoInfo.addEventListener(FlexEvent.CREATION_COMPLETE, function(event:FlexEvent):void{
1607     canvas_playList.addEventListener(FlexEvent.CREATION_COMPLETE, function(event:FlexEvent):void{
1608     label_playListTitle.text = playListName;
1609     });
1610     });
1611     }
1612    
1613     videoUrlMap = new Object();
1614    
1615     playListProvider.removeAll();
1616    
1617     if(this.dataGrid_playList != null){
1618     (dataGrid_playList as DataGrid).dataProvider = playListProvider;
1619     (dataGrid_playList as DataGrid).validateDisplayList();
1620     (dataGrid_playList as DataGrid).validateNow();
1621     }
1622     }
1623    
1624     /**
1625 mineap 476 * ���������������������������������������������
1626 mineap 370 *
1627 mineap 476 * @details edvakf���������������������������
1628     * @see https://github.com/edvakf/NNDDMOD/commit/6984ba8919727a98c249e1bc8a4848705de27df5
1629     */
1630     public function shufflePlayList():void{
1631 mineap 786
1632     var selectedObject:Object = null;
1633     if (dataGrid_playList != null)
1634     {
1635     selectedObject = dataGrid_playList.selectedItem;
1636     }
1637    
1638 mineap 476 var tempArrayCollection:ArrayCollection = new ArrayCollection();
1639     for each(var object:Object in playListProvider){
1640     tempArrayCollection.addItem(object);
1641     }
1642     var i:int = tempArrayCollection.length;
1643     while (--i) {
1644     var j:int = Math.floor( Math.random() * (i + 1) );
1645     if (i == j) {
1646     continue;
1647     }
1648     var object:Object = tempArrayCollection.getItemAt(i);
1649     tempArrayCollection.setItemAt( tempArrayCollection.getItemAt(j), i );
1650     tempArrayCollection.setItemAt( object, j );
1651     }
1652     playListProvider = tempArrayCollection;
1653 mineap 786
1654     if (dataGrid_playList != null && selectedObject != null)
1655     {
1656     dataGrid_playList.selectedItem = selectedObject;
1657     }
1658 mineap 476 }
1659    
1660     /**
1661     *
1662 mineap 370 * @param index
1663     * @return
1664     *
1665     */
1666     public function getPlayListUrl(index:int):String{
1667     var videoTitle:String = playListProvider[index];
1668    
1669     return videoUrlMap[videoTitle];
1670     }
1671    
1672     /**
1673     *
1674     * @param event
1675     *
1676     */
1677     public function playListDragDropHandler(event:DragEvent):void{
1678     if(event.dragInitiator == dataGrid_playList){
1679    
1680     //���������������(������������������������������������������)
1681    
1682     }else{
1683    
1684     //DataGrid���������Drag������������������������������
1685    
1686     if(event.dragInitiator as DataGrid){
1687     var selectedItems:Array = (event.dragInitiator as DataGrid).selectedItems;
1688     var addItems:Array = new Array();
1689    
1690     for(var i:int=0; i<selectedItems.length; i++){
1691    
1692     //������������������������
1693     var url:String = selectedItems[i].dataGridColumn_videoPath;
1694     if(url == null || url == ""){
1695     //��������������� or ���������videoPath���������������������
1696     url = selectedItems[i].dataGridColumn_nicoVideoUrl;
1697    
1698     if(url == null || url == ""){
1699     //������������������������������
1700     url = selectedItems[i].dataGridColumn_videoLocalPath;
1701    
1702     if(url == null || url == ""){
1703     //������������������videoLocalPath���������������������
1704     url = selectedItems[i].dataGridColumn_videoUrl;
1705    
1706     if(url == null || url == ""){
1707     //������������������������
1708     continue;
1709     }
1710     }
1711     }
1712     }
1713    
1714     var title:String = selectedItems[i].dataGridColumn_videoName;
1715     var index:int = title.indexOf("\n");
1716     if(index != -1){
1717     //������������������������������������������������������������������������
1718     title = title.substring(0, index);
1719     }
1720    
1721     addItems.push(title);
1722     addPlayListItem(url, title);
1723     }
1724    
1725     }
1726    
1727     event.dragSource = new DragSource();
1728     event.dragSource.addData(addItems, "items");
1729     }
1730     }
1731    
1732     /**
1733     *
1734     * @param event
1735     *
1736     */
1737     public function playListClearButtonClicked(event:MouseEvent):void{
1738     resetPlayList();
1739     }
1740    
1741 mineap 476 public function playListShuffleButtonClicked(event:MouseEvent):void{
1742     shufflePlayList();
1743     }
1744    
1745 mineap 370 /**
1746     *
1747     * @param event
1748     *
1749     */
1750     public function playListItemDeleteButtonClicked(event:MouseEvent):void{
1751     var selectedIndices:Array = (dataGrid_playList as DataGrid).selectedIndices;
1752    
1753     for(var index:int = selectedIndices.length; index != 0; index--){
1754     removePlayListItem(selectedIndices[index-1]);
1755     }
1756     }
1757    
1758     /**
1759     *
1760     * @param event
1761     *
1762     */
1763     public function playListSaveButtonClicked(event:MouseEvent):void{
1764     //1.���������������������������������������������������������or���������������
1765     //2.���������������������������������������������
1766     //3.������������������������������������
1767     var urlArray:Array = new Array();
1768     var nameArray:Array = new Array();
1769     for each(var name:String in playListProvider){
1770     urlArray.push(videoUrlMap[name]);
1771     nameArray.push(name);
1772     }
1773    
1774     var isExist:Boolean = false;
1775     if(playListName != null){
1776     var playList:PlayList = PlayListManager.instance.isExist(playListName);
1777    
1778     if(playList != null){
1779     isExist = true;
1780     }
1781     }
1782    
1783     if(!isExist){
1784     // ���������������������������
1785     playerController.addNewPlayList(urlArray, nameArray);
1786     }else{
1787 mineap 652 FlexGlobals.topLevelApplication.activate();
1788 mineap 370 Alert.show("���������������������������(" + playListName + ")���������������������������\n���������������������������������������������������������������������������������������", Message.M_MESSAGE, Alert.YES | Alert.NO | Alert.CANCEL, null, function(event:CloseEvent):void{
1789     if(event.detail == Alert.YES){
1790     // ���������
1791     playerController.updatePlayList(playListName, urlArray, nameArray);
1792     }else if(event.detail == Alert.NO){
1793 mineap 652 // ���������������
1794 mineap 370 var title:String = playerController.addNewPlayList(urlArray, nameArray);
1795     label_playListTitle_dataProvider = title;
1796     }else{
1797    
1798     }
1799     });
1800    
1801     }
1802    
1803     }
1804    
1805     /**
1806     *
1807     * @param index
1808     *
1809     */
1810     public function showPlayingTitle(index:int):void{
1811     if(dataGrid_playList != null){
1812     (dataGrid_playList as DataGrid).scrollToIndex(index);
1813     (dataGrid_playList as DataGrid).selectedIndex = index;
1814     }else{
1815     canvas_playList.addEventListener(FlexEvent.CREATION_COMPLETE, function(event:FlexEvent):void{
1816     (dataGrid_playList as DataGrid).scrollToIndex(index);
1817     (dataGrid_playList as DataGrid).selectedIndex = index;
1818     });
1819     }
1820     }
1821    
1822     /**
1823     *
1824     * @param event
1825     *
1826     */
1827     public function tagListDoubleClickEventHandler(event:ListEvent):void{
1828     if(event.itemRenderer.data != null){
1829     if(event.itemRenderer.data is String){
1830     var word:String = String(event.itemRenderer.data);
1831     Application.application.search(new SearchItem(word,
1832     SearchSortString.convertSortTypeFromIndex(4), SearchType.TAG, word));
1833     }
1834     }
1835     }
1836    
1837     /**
1838     *
1839     * @param event
1840     *
1841     */
1842     public function button_goToWebClicked(event:Event):void{
1843     this.playerController.watchOnWeb();
1844     }
1845    
1846     /**
1847     *
1848     * @param event
1849     *
1850     */
1851     public function tweet(event:Event):void{
1852     this.playerController.tweet();
1853     }
1854    
1855     /**
1856     *
1857     * @param event
1858     *
1859     */
1860     public function addHatenaBookmark(event:Event):void{
1861     this.playerController.addHatenaBookmark();
1862     }
1863    
1864     /**
1865     *
1866     * @param event
1867     *
1868     */
1869     public function openNicoSound(event:Event):void{
1870     this.playerController.openNicoSound();
1871     }
1872    
1873 mineap 808 public function openNicoStarSound(event:Event):void
1874     {
1875     this.playerController.openNicoStarSound();
1876     }
1877    
1878 mineap 370 /**
1879     *
1880     * @param event
1881     *
1882     */
1883     public function openNicomimi(event:Event):void{
1884     this.playerController.openNicomimi();
1885     }
1886    
1887     /**
1888     *
1889     * @param event
1890     *
1891     */
1892     public function button_addDownloadList(event:Event):void{
1893    
1894     this.playerController.addDlList();
1895    
1896     }
1897    
1898     /**
1899     *
1900     * @param event
1901     *
1902     */
1903     public function myListAddButtonClicked(event:Event):void{
1904     var selectedItem:Object = comboBox_mylist.selectedItem;
1905    
1906     if(selectedItem != null){
1907     var name:String = String(selectedItem);
1908     this.playerController.addMyList(myListMap[name]);
1909    
1910     }else{
1911    
1912     }
1913     }
1914    
1915     /**
1916     *
1917     * @param myListNames
1918     * @param myListNums
1919     *
1920     */
1921     public function setMyLists(myListNames:Array, myListNums:Array):void{
1922    
1923     var selectedIndex:int = comboBox_mylist.selectedIndex;
1924     var selectedName:String = myListDataProvider[selectedIndex];
1925    
1926     myListDataProvider = new Array();
1927     for(var i:int = 0; i<myListNames.length; i++){
1928     myListMap[myListNames[i]] = myListNums[i];
1929     myListDataProvider[i] = myListNames[i];
1930     if(selectedName == myListDataProvider[i]){
1931     selectedIndex = i;
1932     }
1933     }
1934    
1935     comboBox_mylist.dataProvider = myListDataProvider;
1936    
1937     if(myListDataProvider.length >= 1){
1938     comboBox_mylist.selectedIndex = 0;
1939     }
1940    
1941     comboBox_mylist.validateNow();
1942    
1943     if(selectedIndex == -1){
1944     var value:Object = ConfigManager.getInstance().getItem("infoViewSelectedMyListIndex");
1945     if(value != null){
1946     selectedIndex = int(value);
1947     }else{
1948     selectedIndex = 0;
1949     }
1950     }
1951     comboBox_mylist.selectedIndex = selectedIndex;
1952    
1953     }
1954    
1955     private function ownerTextLinkClicked(event:TextEvent):void{
1956 mineap 675 if (event.text.indexOf("mylist/") != -1)
1957     {
1958 mineap 370 // trace(event.text);
1959 mineap 675 FlexGlobals.topLevelApplication.renewMyList(event.text);
1960     }else if (event.text.indexOf("channel/") != -1)
1961     {
1962     FlexGlobals.topLevelApplication.renewMyList(event.text);
1963     }else if (event.text.indexOf("watch/") != -1)
1964     {
1965 mineap 370 var videoId:String = PathMaker.getVideoID(event.text);
1966     // trace(videoId);
1967     playerController.playMovie("http://www.nicovideo.jp/watch/" + videoId);
1968 mineap 675 }else
1969     {
1970 mineap 370 trace(event);
1971     }
1972     }
1973    
1974     private function playListReverseButtonClicked(event:Event):void{
1975     var tempArrayCollection:ArrayCollection = new ArrayCollection();
1976    
1977 mineap 786 var newIndex:int = -1;
1978     if (dataGrid_playList != null)
1979     {
1980     var selectedIndex:int = dataGrid_playList.selectedIndex;
1981     if (selectedIndex != -1)
1982     {
1983     newIndex = (playListProvider.length-1) - selectedIndex;
1984     }
1985     }
1986    
1987 mineap 370 for each(var object:Object in playListProvider){
1988     tempArrayCollection.addItemAt(object, 0);
1989     }
1990    
1991     playListProvider = tempArrayCollection;
1992 mineap 786
1993     if (dataGrid_playList != null && newIndex != -1)
1994     {
1995     dataGrid_playList.selectedIndex = newIndex;
1996     }
1997 mineap 370 }
1998    
1999     public function get playList():PlayList{
2000     var playList:PlayList = null;
2001    
2002     if(getPlayList().length > 0){
2003    
2004     playList = new PlayList();
2005    
2006     playList.name = playListName;
2007    
2008     for(var index:int = 0; index < (getPlayList() as Array).length; index++){
2009     var path:String = getPlayList()[index];
2010     var name:String = getNameList()[index];
2011     var nnddVideo:NNDDVideo = new NNDDVideo(path, name);
2012    
2013     playList.items.push(nnddVideo);
2014     }
2015     }
2016    
2017     return playList;
2018     }

Back to OSDN">Back to OSDN
ViewVC Help
Powered by ViewVC 1.1.26