| 487 |
|
|
| 488 |
var videoUrl:String = "http://www.nicovideo.jp/watch/"+PathMaker.getVideoID(this._videoID); |
var videoUrl:String = "http://www.nicovideo.jp/watch/"+PathMaker.getVideoID(this._videoID); |
| 489 |
|
|
| 490 |
renewCommentAtStart(PathMaker.getVideoID(this._videoID), videoPath, initStart); |
renewCommentAtStart(PathMaker.getVideoID(this._videoID), videoPath, thumbInfoPath, autoPlay); |
| 491 |
|
|
| 492 |
}else{ |
}else{ |
| 493 |
|
|
| 494 |
/* ログインしていないときは再生を開始 */ |
/* ログインしていないときは再生を開始 */ |
| 495 |
logManager.addLog(Message.FAIL_PLAY_EACH_COMMENT_DOWNLOAD + "(ログインしていません)"); |
logManager.addLog(Message.FAIL_PLAY_EACH_COMMENT_DOWNLOAD + "(ログインしていません)"); |
| 496 |
initStart(); |
initStart(videoPath, thumbInfoPath, autoPlay); |
| 497 |
|
|
| 498 |
} |
} |
| 499 |
|
|
| 504 |
|
|
| 505 |
var timer:Timer = new Timer(1000, 1); |
var timer:Timer = new Timer(1000, 1); |
| 506 |
timer.addEventListener(TimerEvent.TIMER_COMPLETE, function(event:TimerEvent):void{ |
timer.addEventListener(TimerEvent.TIMER_COMPLETE, function(event:TimerEvent):void{ |
| 507 |
initStart(); |
initStart(videoPath, thumbInfoPath, autoPlay); |
| 508 |
|
|
| 509 |
timer.stop(); |
timer.stop(); |
| 510 |
timer = null; |
timer = null; |
| 541 |
logManager.addLog("マイリスト一覧の更新に失敗(動画IDが取得できない)"); |
logManager.addLog("マイリスト一覧の更新に失敗(動画IDが取得できない)"); |
| 542 |
} |
} |
| 543 |
|
|
| 544 |
initStart(); |
initStart(videoPath, thumbInfoPath, autoPlay); |
| 545 |
} |
} |
| 546 |
|
|
| 547 |
/** |
} |
| 548 |
* 匿名メソッド。再生前の初期化を行います。 |
|
| 549 |
*/ |
/** |
| 550 |
function initStart():void{ |
* VideoDisplay、もしくはSWFLoaderを準備し、必要に応じて動画の再生を開始します。 |
| 551 |
|
* |
| 552 |
|
* @param videoPath 動画のパス |
| 553 |
|
* @param thumbInfoPath サムネイル情報のパス |
| 554 |
|
* @param autoPlay 動画の再生を開始するかどうか |
| 555 |
|
*/ |
| 556 |
|
private function initStart(videoPath:String, thumbInfoPath:String, autoPlay:Boolean):void |
| 557 |
|
{ |
| 558 |
|
trace(videoPlayer.stage.quality); |
| 559 |
|
|
| 560 |
|
try{ |
| 561 |
|
if(_isEconomyMode){ |
| 562 |
|
videoPlayer.label_economyStatus.text = "エコノミーモード"; |
| 563 |
|
}else{ |
| 564 |
|
videoPlayer.label_economyStatus.text = ""; |
| 565 |
|
} |
| 566 |
|
|
| 567 |
trace(videoPlayer.stage.quality); |
videoPlayer.canvas_video.toolTip = null; |
| 568 |
|
|
| 569 |
try{ |
if(isPlayerClosing){ |
| 570 |
if(_isEconomyMode){ |
stop(); |
| 571 |
videoPlayer.label_economyStatus.text = "エコノミーモード"; |
destructor(); |
| 572 |
}else{ |
return; |
| 573 |
videoPlayer.label_economyStatus.text = ""; |
} |
| 574 |
} |
|
| 575 |
|
commentTimerVpos = 0; |
| 576 |
|
|
| 577 |
|
var text:Text = new Text(); |
| 578 |
|
text.text = "ユーザーニコ割がダウンロード済であれば、この領域で再生されます。\n画面をダブルクリックすると非表示に出来ます。"; |
| 579 |
|
text.setConstraintValue("left", 10); |
| 580 |
|
text.setConstraintValue("top", 10); |
| 581 |
|
videoPlayer.canvas_nicowari.addChild(text); |
| 582 |
|
|
| 583 |
|
videoPlayer.label_downloadStatus.text = ""; |
| 584 |
|
videoInfoView.image_thumbImg.source = ""; |
| 585 |
|
videoPlayer.videoInfoView.text_info.htmlText ="(タイトルを取得中)<br />(投稿日時を取得中)<br />再生: コメント: マイリスト:" |
| 586 |
|
|
| 587 |
|
if(isStreamingPlay){ |
| 588 |
|
//最新の情報はDL済みなのでそれを使う |
| 589 |
|
setInfo(downLoadedURL, thumbInfoPath, thumbInfoPath.substring(0, thumbInfoPath.lastIndexOf("/")) + "/nndd[IchibaInfo].html", true); |
| 590 |
|
|
| 591 |
videoPlayer.canvas_video.toolTip = null; |
videoInfoView.image_thumbImg.source = thumbInfoPath.substring(0, thumbInfoPath.lastIndexOf("/")) + "/nndd[ThumbImg].jpeg"; |
| 592 |
|
}else{ |
| 593 |
|
setInfo(videoPath, thumbInfoPath, PathMaker.createNicoIchibaInfoPathByVideoPath(videoPath), false); |
| 594 |
|
|
| 595 |
if(isPlayerClosing){ |
var nnddVideo:NNDDVideo = libraryManager.isExist(PathMaker.getVideoID(videoPath)); |
| 596 |
stop(); |
|
| 597 |
destructor(); |
if(nnddVideo != null){ |
| 598 |
return; |
videoInfoView.image_thumbImg.source = nnddVideo.thumbUrl; |
| 599 |
} |
} |
| 600 |
|
} |
| 601 |
|
|
| 602 |
|
changeFps(videoInfoView.fps); |
| 603 |
|
|
| 604 |
|
videoPlayer.videoController.label_time.text = "0:00/0:00"; |
| 605 |
|
videoPlayer.videoController_under.label_time.text = "0:00/0:00"; |
| 606 |
|
|
| 607 |
|
if(videoInfoView.isShowAlwaysNicowariArea){ |
| 608 |
|
//ニコ割領域を常に表示する |
| 609 |
|
videoPlayer.showNicowariArea(); |
| 610 |
|
|
| 611 |
commentTimerVpos = 0; |
}else{ |
| 612 |
|
//ニコ割は再生時のみ表示 |
| 613 |
|
videoPlayer.hideNicowariArea(); |
| 614 |
|
|
| 615 |
var text:Text = new Text(); |
} |
| 616 |
text.text = "ユーザーニコ割がダウンロード済であれば、この領域で再生されます。\n画面をダブルクリックすると非表示に出来ます。"; |
|
| 617 |
text.setConstraintValue("left", 10); |
var video:NNDDVideo = libraryManager.isExist(LibraryUtil.getVideoKey(_videoID)); |
| 618 |
text.setConstraintValue("top", 10); |
if(video != null){ |
| 619 |
videoPlayer.canvas_nicowari.addChild(text); |
HistoryManager.instance.addVideoByNNDDVideo(video); |
| 620 |
|
}else{ |
| 621 |
|
video = new NNDDVideo("http://www.nicovideo.jp/watch/" + PathMaker.getVideoID(_videoID), videoPlayer.title, false, null, null, null, PathMaker.getThumbImgUrl(PathMaker.getVideoID(_videoID))); |
| 622 |
|
|
| 623 |
|
HistoryManager.instance.addVideoByNNDDVideo(video, null, false); |
| 624 |
|
} |
| 625 |
|
|
| 626 |
|
if(windowType == PlayerController.WINDOW_TYPE_FLV){ |
| 627 |
|
//WINDOW_TYPE_FLVで初期化する場合の処理 |
| 628 |
|
|
| 629 |
|
isMovieClipPlaying = false; |
| 630 |
|
|
| 631 |
|
videoDisplay = new VideoDisplay(); |
| 632 |
|
|
| 633 |
videoPlayer.label_downloadStatus.text = ""; |
videoPlayer.label_downloadStatus.text = ""; |
|
videoInfoView.image_thumbImg.source = ""; |
|
|
videoPlayer.videoInfoView.text_info.htmlText ="(タイトルを取得中)<br />(投稿日時を取得中)<br />再生: コメント: マイリスト:" |
|
| 634 |
|
|
| 635 |
if(isStreamingPlay){ |
if(isStreamingPlay){ |
| 636 |
//最新の情報はDL済みなのでそれを使う |
videoPlayer.label_downloadStatus.text = "バッファ中..."; |
| 637 |
setInfo(downLoadedURL, thumbInfoPath, thumbInfoPath.substring(0, thumbInfoPath.lastIndexOf("/")) + "/nndd[IchibaInfo].html", true); |
videoDisplay.addEventListener(MediaPlayerStateChangeEvent.MEDIA_PLAYER_STATE_CHANGE, mediaPlayerStateChanged); |
| 638 |
|
} |
| 639 |
videoInfoView.image_thumbImg.source = thumbInfoPath.substring(0, thumbInfoPath.lastIndexOf("/")) + "/nndd[ThumbImg].jpeg"; |
|
| 640 |
|
videoPlayer.canvas_video.removeAllChildren(); |
| 641 |
|
videoPlayer.canvas_video.addChild(videoDisplay); |
| 642 |
|
|
| 643 |
|
videoDisplay.setConstraintValue("bottom", 0); |
| 644 |
|
videoDisplay.setConstraintValue("left", 0); |
| 645 |
|
videoDisplay.setConstraintValue("right", 0); |
| 646 |
|
videoDisplay.setConstraintValue("top", 0); |
| 647 |
|
|
| 648 |
|
if(videoPath.length > 4 && videoPath.substr(0,4) == "http"){ |
| 649 |
|
videoInfoView.videoServerUrl = videoPath.substring(0, videoPath.lastIndexOf("/")); |
| 650 |
}else{ |
}else{ |
| 651 |
setInfo(videoPath, thumbInfoPath, PathMaker.createNicoIchibaInfoPathByVideoPath(videoPath), false); |
videoInfoView.videoServerUrl = videoPath; |
| 652 |
|
var messageServerUrl:String = PathMaker.createNomalCommentPathByVideoPath(videoPath); |
| 653 |
var nnddVideo:NNDDVideo = libraryManager.isExist(PathMaker.getVideoID(videoPath)); |
if(messageServerUrl != null){ |
| 654 |
|
videoInfoView.messageServerUrl = messageServerUrl; |
|
if(nnddVideo != null){ |
|
|
videoInfoView.image_thumbImg.source = nnddVideo.thumbUrl; |
|
| 655 |
} |
} |
| 656 |
} |
} |
| 657 |
|
videoInfoView.videoType = "FLV/MP4"; |
| 658 |
|
|
| 659 |
changeFps(videoInfoView.fps); |
videoDisplay.autoPlay = autoPlay; |
| 660 |
|
videoDisplay.source = videoPath; |
| 661 |
|
videoDisplay.autoRewind = false; |
| 662 |
|
videoDisplay.volume = videoPlayer.videoController.slider_volume.value; |
| 663 |
|
videoPlayer.videoController_under.slider_volume.value = videoPlayer.videoController.slider_volume.value; |
| 664 |
|
|
| 665 |
videoPlayer.videoController.label_time.text = "0:00/0:00"; |
addVideoDisplayEventListeners(videoDisplay); |
| 666 |
videoPlayer.videoController_under.label_time.text = "0:00/0:00"; |
|
| 667 |
|
commentManager.initComment(comments, videoPlayer.canvas_video); |
| 668 |
if(videoInfoView.isShowAlwaysNicowariArea){ |
commentManager.setCommentAlpha(videoInfoView.commentAlpha/100); |
| 669 |
//ニコ割領域を常に表示する |
|
| 670 |
videoPlayer.showNicowariArea(); |
windowReady = true; |
| 671 |
|
|
| 672 |
}else{ |
if(autoPlay && !isStreamingPlay){ |
| 673 |
//ニコ割は再生時のみ表示 |
time = (new Date).time; |
| 674 |
videoPlayer.hideNicowariArea(); |
commentTimer.start(); |
|
|
|
| 675 |
} |
} |
| 676 |
|
|
| 677 |
|
videoDisplay.addEventListener(LoadEvent.BYTES_LOADED_CHANGE, byteloadedChangedEventHandler); |
| 678 |
|
videoDisplay.addEventListener(TimeEvent.CURRENT_TIME_CHANGE, osmfCurrentTimeChangeEventHandler); |
| 679 |
|
videoDisplay.addEventListener(MouseEvent.CLICK, function(event:MouseEvent):void{ |
| 680 |
|
event.currentTarget.setFocus(); |
| 681 |
|
}); |
| 682 |
|
|
| 683 |
var video:NNDDVideo = libraryManager.isExist(LibraryUtil.getVideoKey(_videoID)); |
videoPlayer.videoController.button_play.setStyle("icon", icon_Pause); |
| 684 |
if(video != null){ |
videoPlayer.videoController_under.button_play.setStyle("icon", icon_Pause); |
| 685 |
HistoryManager.instance.addVideoByNNDDVideo(video); |
setVolume(videoPlayer.videoController.slider_volume.value); |
| 686 |
}else{ |
|
| 687 |
video = new NNDDVideo("http://www.nicovideo.jp/watch/" + PathMaker.getVideoID(_videoID), videoPlayer.title, false, null, null, null, PathMaker.getThumbImgUrl(PathMaker.getVideoID(_videoID))); |
if(videoInfoView.visible){ |
| 688 |
|
videoInfoView.restore(); |
| 689 |
HistoryManager.instance.addVideoByNNDDVideo(video, null, false); |
} |
| 690 |
|
if(videoPlayer.stage.displayState != StageDisplayState.FULL_SCREEN_INTERACTIVE){ |
| 691 |
|
videoPlayer.restore(); |
| 692 |
} |
} |
| 693 |
|
|
| 694 |
if(windowType == PlayerController.WINDOW_TYPE_FLV){ |
if(videoInfoView.visible){ |
| 695 |
//WINDOW_TYPE_FLVで初期化する場合の処理 |
videoInfoView.activate(); |
| 696 |
|
} |
| 697 |
isMovieClipPlaying = false; |
videoPlayer.activate(); |
| 698 |
|
|
| 699 |
videoDisplay = new VideoDisplay(); |
windowResized(false); |
| 700 |
|
|
| 701 |
videoPlayer.label_downloadStatus.text = ""; |
videoPlayer.setControllerEnable(true); |
| 702 |
|
|
| 703 |
if(isStreamingPlay){ |
}else if(windowType == PlayerController.WINDOW_TYPE_SWF){ |
| 704 |
videoPlayer.label_downloadStatus.text = "バッファ中..."; |
//WINODW_TYPE_SWFで初期化する場合の処理 |
| 705 |
videoDisplay.addEventListener(MediaPlayerStateChangeEvent.MEDIA_PLAYER_STATE_CHANGE, mediaPlayerStateChanged); |
|
| 706 |
} |
isMovieClipPlaying = true; |
| 707 |
|
isSwfConverting = true; |
| 708 |
videoPlayer.canvas_video.removeAllChildren(); |
|
| 709 |
videoPlayer.canvas_video.addChild(videoDisplay); |
videoPlayer.label_downloadStatus.text = "SWFを変換しています..."; |
| 710 |
|
|
| 711 |
videoDisplay.setConstraintValue("bottom", 0); |
loader = new Loader(); |
| 712 |
videoDisplay.setConstraintValue("left", 0); |
loader.contentLoaderInfo.addEventListener(Event.COMPLETE, convertCompleteHandler); |
| 713 |
videoDisplay.setConstraintValue("right", 0); |
var fLoader:ForcibleLoader = new ForcibleLoader(loader); |
| 714 |
videoDisplay.setConstraintValue("top", 0); |
swfLoader = new SWFLoader(); |
| 715 |
// videoDisplay.bufferTime = 3; |
swfLoader.addChild(loader); |
| 716 |
|
|
| 717 |
if(videoPath.length > 4 && videoPath.substr(0,4) == "http"){ |
videoPlayer.canvas_video.removeAllChildren(); |
| 718 |
videoInfoView.videoServerUrl = videoPath.substring(0, videoPath.lastIndexOf("/")); |
videoPlayer.canvas_video.addChild(swfLoader); |
| 719 |
}else{ |
|
| 720 |
videoInfoView.videoServerUrl = videoPath; |
swfLoader.setConstraintValue("bottom", 0); |
| 721 |
var messageServerUrl:String = PathMaker.createNomalCommentPathByVideoPath(videoPath); |
swfLoader.setConstraintValue("left", 0); |
| 722 |
if(messageServerUrl != null){ |
swfLoader.setConstraintValue("right", 0); |
| 723 |
videoInfoView.messageServerUrl = messageServerUrl; |
swfLoader.setConstraintValue("top", 0); |
| 724 |
} |
|
| 725 |
} |
swfLoader.addEventListener(MouseEvent.CLICK, function(event:MouseEvent):void{ |
| 726 |
videoInfoView.videoType = "FLV/MP4"; |
event.currentTarget.setFocus(); |
| 727 |
|
}); |
| 728 |
videoDisplay.autoPlay = autoPlay; |
|
| 729 |
videoDisplay.source = videoPath; |
commentManager.initComment(comments, videoPlayer.canvas_video); |
| 730 |
videoDisplay.autoRewind = false; |
commentManager.setCommentAlpha(videoInfoView.commentAlpha/100); |
| 731 |
videoDisplay.volume = videoPlayer.videoController.slider_volume.value; |
|
| 732 |
videoPlayer.videoController_under.slider_volume.value = videoPlayer.videoController.slider_volume.value; |
windowReady = true; |
| 733 |
|
|
| 734 |
addVideoDisplayEventListeners(videoDisplay); |
if(videoPath.length > 4 && videoPath.substr(0,4) == "http"){ |
| 735 |
|
videoInfoView.videoServerUrl = videoPath.substring(0, videoPath.lastIndexOf("/")); |
| 736 |
commentManager.initComment(comments, videoPlayer.canvas_video); |
}else{ |
| 737 |
commentManager.setCommentAlpha(videoInfoView.commentAlpha/100); |
videoInfoView.videoServerUrl = videoPath; |
| 738 |
|
var messageServerUrl:String = PathMaker.createNomalCommentPathByVideoPath(videoPath); |
| 739 |
windowReady = true; |
if(messageServerUrl != null){ |
| 740 |
|
videoInfoView.messageServerUrl = messageServerUrl; |
|
if(autoPlay && !isStreamingPlay){ |
|
|
time = (new Date).time; |
|
|
commentTimer.start(); |
|
|
} |
|
|
|
|
|
videoDisplay.addEventListener(LoadEvent.BYTES_LOADED_CHANGE, byteloadedChangedEventHandler); |
|
|
videoDisplay.addEventListener(TimeEvent.CURRENT_TIME_CHANGE, osmfCurrentTimeChangeEventHandler); |
|
|
videoDisplay.addEventListener(MouseEvent.CLICK, function(event:MouseEvent):void{ |
|
|
event.currentTarget.setFocus(); |
|
|
}); |
|
|
|
|
|
videoPlayer.videoController.button_play.setStyle("icon", icon_Pause); |
|
|
videoPlayer.videoController_under.button_play.setStyle("icon", icon_Pause); |
|
|
setVolume(videoPlayer.videoController.slider_volume.value); |
|
|
|
|
|
if(videoInfoView.visible){ |
|
|
videoInfoView.restore(); |
|
|
} |
|
|
if(videoPlayer.stage.displayState != StageDisplayState.FULL_SCREEN_INTERACTIVE){ |
|
|
videoPlayer.restore(); |
|
|
} |
|
|
|
|
|
if(videoInfoView.visible){ |
|
|
videoInfoView.activate(); |
|
| 741 |
} |
} |
| 742 |
videoPlayer.activate(); |
} |
| 743 |
|
videoInfoView.videoType = "SWF"; |
| 744 |
|
if(autoPlay){ |
| 745 |
|
fLoader.load(new URLRequest(videoPath)); |
| 746 |
|
} |
| 747 |
|
|
| 748 |
|
var timer:Timer = new Timer(500, 4); |
| 749 |
|
timer.addEventListener(TimerEvent.TIMER, function():void{ |
| 750 |
windowResized(false); |
windowResized(false); |
| 751 |
|
}); |
| 752 |
videoPlayer.setControllerEnable(true); |
timer.start(); |
| 753 |
|
|
| 754 |
}else if(windowType == PlayerController.WINDOW_TYPE_SWF){ |
videoPlayer.videoController_under.button_play.setStyle("icon", icon_Pause); |
| 755 |
//WINODW_TYPE_SWFで初期化する場合の処理 |
videoPlayer.videoController.button_play.setStyle("icon", icon_Pause); |
| 756 |
|
|
| 757 |
isMovieClipPlaying = true; |
if(videoInfoView.visible){ |
| 758 |
isSwfConverting = true; |
videoInfoView.restore(); |
|
|
|
|
videoPlayer.label_downloadStatus.text = "SWFを変換しています..."; |
|
|
|
|
|
loader = new Loader(); |
|
|
loader.contentLoaderInfo.addEventListener(Event.COMPLETE, convertCompleteHandler); |
|
|
var fLoader:ForcibleLoader = new ForcibleLoader(loader); |
|
|
swfLoader = new SWFLoader(); |
|
|
swfLoader.addChild(loader); |
|
|
|
|
|
videoPlayer.canvas_video.removeAllChildren(); |
|
|
videoPlayer.canvas_video.addChild(swfLoader); |
|
|
|
|
|
swfLoader.setConstraintValue("bottom", 0); |
|
|
swfLoader.setConstraintValue("left", 0); |
|
|
swfLoader.setConstraintValue("right", 0); |
|
|
swfLoader.setConstraintValue("top", 0); |
|
|
|
|
|
swfLoader.addEventListener(MouseEvent.CLICK, function(event:MouseEvent):void{ |
|
|
event.currentTarget.setFocus(); |
|
|
}); |
|
|
|
|
|
commentManager.initComment(comments, videoPlayer.canvas_video); |
|
|
commentManager.setCommentAlpha(videoInfoView.commentAlpha/100); |
|
|
|
|
|
windowReady = true; |
|
|
|
|
|
if(videoPath.length > 4 && videoPath.substr(0,4) == "http"){ |
|
|
videoInfoView.videoServerUrl = videoPath.substring(0, videoPath.lastIndexOf("/")); |
|
|
}else{ |
|
|
videoInfoView.videoServerUrl = videoPath; |
|
|
var messageServerUrl:String = PathMaker.createNomalCommentPathByVideoPath(videoPath); |
|
|
if(messageServerUrl != null){ |
|
|
videoInfoView.messageServerUrl = messageServerUrl; |
|
|
} |
|
|
} |
|
|
videoInfoView.videoType = "SWF"; |
|
|
if(autoPlay){ |
|
|
fLoader.load(new URLRequest(videoPath)); |
|
|
} |
|
|
|
|
|
var timer:Timer = new Timer(500, 4); |
|
|
timer.addEventListener(TimerEvent.TIMER, function():void{ |
|
|
windowResized(false); |
|
|
}); |
|
|
timer.start(); |
|
|
|
|
|
videoPlayer.videoController_under.button_play.setStyle("icon", icon_Pause); |
|
|
videoPlayer.videoController.button_play.setStyle("icon", icon_Pause); |
|
|
|
|
|
if(videoInfoView.visible){ |
|
|
videoInfoView.restore(); |
|
|
} |
|
|
|
|
|
if(videoPlayer.stage.displayState != StageDisplayState.FULL_SCREEN_INTERACTIVE){ |
|
|
videoPlayer.restore(); |
|
|
} |
|
|
|
|
|
if(videoInfoView.visible){ |
|
|
videoInfoView.activate(); |
|
|
} |
|
|
videoPlayer.activate(); |
|
|
|
|
|
videoPlayer.setControllerEnable(true); |
|
|
|
|
| 759 |
} |
} |
| 760 |
|
|
| 761 |
if(videoInfoView != null && videoInfoView.tabNavigator_comment != null){ |
if(videoPlayer.stage.displayState != StageDisplayState.FULL_SCREEN_INTERACTIVE){ |
| 762 |
if(videoInfoView.tabNavigator_comment.selectedIndex == 1){ |
videoPlayer.restore(); |
|
// 過去コメントタブが選択されてるときはコメントを再ロード |
|
|
videoInfoView.reloadOldComment(); |
|
|
}else{ |
|
|
// 選択されていないときは時刻をリセット |
|
|
videoInfoView.resetOldCommentDate(); |
|
|
} |
|
| 763 |
} |
} |
| 764 |
|
|
| 765 |
return; |
if(videoInfoView.visible){ |
| 766 |
}catch(error:Error){ |
videoInfoView.activate(); |
| 767 |
trace(error.getStackTrace()); |
} |
| 768 |
logManager.addLog(error + ":" + error.getStackTrace()); |
videoPlayer.activate(); |
| 769 |
// destructor(); |
|
| 770 |
|
videoPlayer.setControllerEnable(true); |
| 771 |
|
|
| 772 |
} |
} |
| 773 |
|
|
| 774 |
|
if(videoInfoView != null && videoInfoView.tabNavigator_comment != null){ |
| 775 |
|
if(videoInfoView.tabNavigator_comment.selectedIndex == 1){ |
| 776 |
|
// 過去コメントタブが選択されてるときはコメントを再ロード |
| 777 |
|
videoInfoView.reloadOldComment(); |
| 778 |
|
}else{ |
| 779 |
|
// 選択されていないときは時刻をリセット |
| 780 |
|
videoInfoView.resetOldCommentDate(); |
| 781 |
|
} |
| 782 |
|
} |
| 783 |
|
|
| 784 |
|
return; |
| 785 |
|
}catch(error:Error){ |
| 786 |
|
trace(error.getStackTrace()); |
| 787 |
|
logManager.addLog(error + ":" + error.getStackTrace()); |
| 788 |
} |
} |
|
|
|
| 789 |
} |
} |
| 790 |
|
|
| 791 |
|
|
| 792 |
/** |
/** |
| 793 |
* コメントを最新に更新します |
* コメントを最新に更新します |
| 794 |
* |
* |
| 795 |
* @param videoId |
* @param videoId |
| 796 |
* @param videoPath |
* @param videoPath |
| 797 |
* @param initStart |
* @param thumbInfoPath |
| 798 |
|
* @param autoPlay |
| 799 |
* |
* |
| 800 |
*/ |
*/ |
| 801 |
private function renewCommentAtStart(videoId:String, videoPath:String, initStart:Function):void{ |
private function renewCommentAtStart(videoId:String, videoPath:String, thumbInfoPath:String, autoPlay:Boolean):void{ |
| 802 |
|
|
| 803 |
var videoName:String = PathMaker.getVideoName(videoPath); |
var videoName:String = PathMaker.getVideoName(videoPath); |
| 804 |
|
|
| 872 |
|
|
| 873 |
myListGroupUpdate(PathMaker.getVideoID(_videoID)); |
myListGroupUpdate(PathMaker.getVideoID(_videoID)); |
| 874 |
|
|
| 875 |
initStart(); |
initStart(videoPath, thumbInfoPath, autoPlay); |
| 876 |
}); |
}); |
| 877 |
renewDownloadManager.addEventListener(NNDDDownloader.COMMENT_GET_SUCCESS, getProgressListener); |
renewDownloadManager.addEventListener(NNDDDownloader.COMMENT_GET_SUCCESS, getProgressListener); |
| 878 |
renewDownloadManager.addEventListener(NNDDDownloader.GETFLV_API_ACCESS_SUCCESS, getProgressListener); |
renewDownloadManager.addEventListener(NNDDDownloader.GETFLV_API_ACCESS_SUCCESS, getProgressListener); |
| 905 |
var timer:Timer = new Timer(1000, 1); |
var timer:Timer = new Timer(1000, 1); |
| 906 |
timer.addEventListener(TimerEvent.TIMER_COMPLETE, function(event:Event):void{ |
timer.addEventListener(TimerEvent.TIMER_COMPLETE, function(event:Event):void{ |
| 907 |
myListGroupUpdate(PathMaker.getVideoID(_videoID)); |
myListGroupUpdate(PathMaker.getVideoID(_videoID)); |
| 908 |
initStart(); |
initStart(videoPath, thumbInfoPath, autoPlay); |
| 909 |
}); |
}); |
| 910 |
timer.start(); |
timer.start(); |
| 911 |
}); |
}); |
| 917 |
var timer:Timer = new Timer(1000, 1); |
var timer:Timer = new Timer(1000, 1); |
| 918 |
timer.addEventListener(TimerEvent.TIMER_COMPLETE, function():void{ |
timer.addEventListener(TimerEvent.TIMER_COMPLETE, function():void{ |
| 919 |
myListGroupUpdate(PathMaker.getVideoID(_videoID)); |
myListGroupUpdate(PathMaker.getVideoID(_videoID)); |
| 920 |
initStart(); |
initStart(videoPath, thumbInfoPath, autoPlay); |
| 921 |
}); |
}); |
| 922 |
timer.start(); |
timer.start(); |
| 923 |
}); |
}); |
| 1851 |
* |
* |
| 1852 |
*/ |
*/ |
| 1853 |
private function videoPlayCompleteWaitHandler(event:TimerEvent):void{ |
private function videoPlayCompleteWaitHandler(event:TimerEvent):void{ |
| 1854 |
if(!isCounted){ |
if (!isCounted) |
| 1855 |
|
{ |
| 1856 |
//再生回数を加算 |
//再生回数を加算 |
| 1857 |
var videoId:String = LibraryUtil.getVideoKey(this.videoPlayer.title); |
var videoId:String = LibraryUtil.getVideoKey(this.videoPlayer.title); |
| 1858 |
if(videoId != null){ |
if (videoId != null) |
| 1859 |
|
{ |
| 1860 |
addVideoPlayCount(videoId, true); |
addVideoPlayCount(videoId, true); |
| 1861 |
} |
} |
| 1862 |
isCounted = true; |
isCounted = true; |
| 1864 |
|
|
| 1865 |
logManager.addLog("***動画の停止***"); |
logManager.addLog("***動画の停止***"); |
| 1866 |
|
|
| 1867 |
if(videoPlayer.isRepeat){ |
if (videoPlayer.isRepeat) |
| 1868 |
if(isPlayListingPlay){ |
{ |
| 1869 |
if(isStreamingPlay){ |
|
| 1870 |
|
/* 動画の1曲リピート */ |
| 1871 |
|
|
| 1872 |
|
if (isPlayListingPlay) |
| 1873 |
|
{ |
| 1874 |
|
if(isStreamingPlay) |
| 1875 |
|
{ |
| 1876 |
logManager.addLog("***動画のリピート(ストリーミング)***"); |
logManager.addLog("***動画のリピート(ストリーミング)***"); |
| 1877 |
this.seek(0); |
this.seek(0); |
| 1878 |
if(this.videoDisplay != null){ |
if (this.videoDisplay != null) |
| 1879 |
|
{ |
| 1880 |
this.videoDisplay.play(); |
this.videoDisplay.play(); |
| 1881 |
} |
} |
| 1882 |
}else{ |
} |
| 1883 |
|
else |
| 1884 |
|
{ |
| 1885 |
logManager.addLog("***動画のリピート(ローカル)***"); |
logManager.addLog("***動画のリピート(ローカル)***"); |
| 1886 |
this.stop(); |
this.stop(); |
| 1887 |
playMovie(this.videoInfoView.getPlayListUrl(playingIndex), this.videoInfoView.playList, playingIndex, this.videoPlayer.title); |
playMovie( |
| 1888 |
|
this.videoInfoView.getPlayListUrl(playingIndex), |
| 1889 |
|
this.videoInfoView.playList, |
| 1890 |
|
playingIndex, |
| 1891 |
|
this.videoPlayer.title); |
| 1892 |
|
|
| 1893 |
} |
} |
| 1894 |
}else if(isStreamingPlay){ |
} |
| 1895 |
|
else if(isStreamingPlay) |
| 1896 |
|
{ |
| 1897 |
logManager.addLog("***動画のリピート(ストリーミング)***"); |
logManager.addLog("***動画のリピート(ストリーミング)***"); |
| 1898 |
this.seek(0); |
this.seek(0); |
| 1899 |
if(this.videoDisplay != null){ |
if (this.videoDisplay != null) |
| 1900 |
|
{ |
| 1901 |
this.videoDisplay.play(); |
this.videoDisplay.play(); |
| 1902 |
} |
} |
| 1903 |
}else{ |
} |
| 1904 |
|
else |
| 1905 |
|
{ |
| 1906 |
logManager.addLog("***動画のリピート(ローカル)***"); |
logManager.addLog("***動画のリピート(ローカル)***"); |
| 1907 |
this.stop(); |
this.stop(); |
| 1908 |
this.play(); |
this.play(); |
| 1909 |
} |
} |
| 1910 |
}else{ |
} |
| 1911 |
|
else |
| 1912 |
|
{ |
| 1913 |
|
|
| 1914 |
|
/* 動画のリピートは無効 */ |
| 1915 |
|
|
| 1916 |
this.stop(); |
this.stop(); |
| 1917 |
if(isPlayListingPlay){ |
|
| 1918 |
|
if (isPlayListingPlay) |
| 1919 |
|
{ |
| 1920 |
|
|
| 1921 |
|
/* プレイリスト再生中 */ |
| 1922 |
|
|
| 1923 |
logManager.addLog("***動画の再生(ローカル)***"); |
logManager.addLog("***動画の再生(ローカル)***"); |
| 1924 |
var windowType:int = PlayerController.WINDOW_TYPE_FLV; |
var windowType:int = PlayerController.WINDOW_TYPE_FLV; |
| 1925 |
if(playingIndex >= this.videoInfoView.getPlayList().length-1){ |
if (playingIndex >= this.videoInfoView.getPlayList().length-1) |
| 1926 |
|
{ |
| 1927 |
|
/* プレイリストの先頭に戻る */ |
| 1928 |
playingIndex = 0; |
playingIndex = 0; |
| 1929 |
if(this.videoPlayer.videoInfoView.isRepeatAll()){ |
if (this.videoPlayer.videoInfoView.isRepeatAll()) |
| 1930 |
playMovie(this.videoInfoView.getPlayListUrl(playingIndex), this.videoInfoView.playList, |
{ |
| 1931 |
playingIndex, PathMaker.getVideoName(this.videoInfoView.getPlayListUrl(playingIndex))); |
playMovie( |
| 1932 |
|
this.videoInfoView.getPlayListUrl(playingIndex), |
| 1933 |
|
this.videoInfoView.playList, |
| 1934 |
|
playingIndex, |
| 1935 |
|
PathMaker.getVideoName(this.videoInfoView.getPlayListUrl(playingIndex))); |
| 1936 |
} |
} |
| 1937 |
}else{ |
} |
| 1938 |
|
else |
| 1939 |
|
{ |
| 1940 |
|
/* プレイリストの次の項目へ */ |
| 1941 |
playingIndex++; |
playingIndex++; |
| 1942 |
playMovie(this.videoInfoView.getPlayListUrl(playingIndex), this.videoInfoView.playList, |
playMovie( |
| 1943 |
playingIndex, PathMaker.getVideoName(this.videoInfoView.getPlayListUrl(playingIndex))); |
this.videoInfoView.getPlayListUrl(playingIndex), |
| 1944 |
|
this.videoInfoView.playList, |
| 1945 |
|
playingIndex, |
| 1946 |
|
PathMaker.getVideoName(this.videoInfoView.getPlayListUrl(playingIndex))); |
| 1947 |
} |
} |
| 1948 |
} |
} |
| 1949 |
} |
} |
| 2072 |
return; |
return; |
| 2073 |
} |
} |
| 2074 |
|
|
| 2075 |
// 音量を反映 |
// 音量を反映 |
| 2076 |
this.setVolume(this.videoPlayer.videoController.slider_volume.value); |
this.setVolume(this.videoPlayer.videoController.slider_volume.value); |
| 2077 |
|
|
| 2078 |
var nowSec:String="00",nowMin:String="0"; |
var nowSec:String="00",nowMin:String="0"; |
| 3528 |
url = decodeURIComponent(url); |
url = decodeURIComponent(url); |
| 3529 |
|
|
| 3530 |
if(url.indexOf("http://") == -1){ |
if(url.indexOf("http://") == -1){ |
| 3531 |
|
/* ---- ローカルの動画を再生 ---- */ |
| 3532 |
|
|
| 3533 |
videoPlayer.title = url; |
videoPlayer.title = url; |
| 3534 |
videoPlayer.setControllerEnable(true); |
videoPlayer.setControllerEnable(true); |
| 3535 |
logManager.addLog("***動画の再生(ローカル)***"); |
logManager.addLog("***動画の再生(ローカル)***"); |
| 3624 |
} |
} |
| 3625 |
} |
} |
| 3626 |
}else if(url.match(new RegExp("http://smile")) != null){ |
}else if(url.match(new RegExp("http://smile")) != null){ |
| 3627 |
|
|
| 3628 |
|
/* ストリーミング再生(接続先動画サーバがわかっている時) */ |
| 3629 |
|
|
| 3630 |
logManager.addLog("***動画の再生(ストリーミング)***"); |
logManager.addLog("***動画の再生(ストリーミング)***"); |
| 3631 |
|
|
| 3632 |
var commentPath:String = libraryManager.tempDir.url + "/nndd.xml"; |
var commentPath:String = libraryManager.tempDir.url + "/nndd.xml"; |
| 3672 |
} |
} |
| 3673 |
} |
} |
| 3674 |
}else if(url.match(new RegExp("http://www.nicovideo.jp/watch/")) != null){ |
}else if(url.match(new RegExp("http://www.nicovideo.jp/watch/")) != null){ |
| 3675 |
|
|
| 3676 |
|
/* ストリーミング再生(接続先動画サーバがまだわかっていない時) */ |
| 3677 |
|
|
| 3678 |
logManager.addLog("***ストリーミング再生の準備***"); |
logManager.addLog("***ストリーミング再生の準備***"); |
| 3679 |
if(mailAddress == "" || password == ""){ |
if(mailAddress == "" || password == ""){ |
| 3680 |
Alert.show("ニコニコ動画にログインしてください。", Message.M_ERROR); |
Alert.show("ニコニコ動画にログインしてください。", Message.M_ERROR); |