| 71 |
import org.osmf.events.LoadEvent; |
import org.osmf.events.LoadEvent; |
| 72 |
import org.osmf.events.MediaPlayerStateChangeEvent; |
import org.osmf.events.MediaPlayerStateChangeEvent; |
| 73 |
import org.osmf.events.TimeEvent; |
import org.osmf.events.TimeEvent; |
| 74 |
|
import org.osmf.layout.ScaleMode; |
| 75 |
import org.osmf.media.MediaPlayerState; |
import org.osmf.media.MediaPlayerState; |
| 76 |
|
|
| 77 |
import spark.components.VideoDisplay; |
import spark.components.VideoDisplay; |
| 78 |
|
|
| 79 |
/** |
/** |
| 80 |
* ニコニコ動画からのダウンロードを処理およびその他のGUI関連処理を行う。 |
* ニコニコ動画からのダウンロードを処理およびその他のGUI関連処理を行う。 |
| 161 |
public static const NICO_SWF_WIDTH:int = 512; |
public static const NICO_SWF_WIDTH:int = 512; |
| 162 |
|
|
| 163 |
public static const NICO_VIDEO_WINDOW_HEIGHT:int = 384; |
public static const NICO_VIDEO_WINDOW_HEIGHT:int = 384; |
| 164 |
public static const NICO_VIDEO_WINDOW_WIDTH:int = 544; |
public static const NICO_VIDEO_WINDOW_WIDTH:int = 512; |
| 165 |
public static const NICO_VIDEO_WINDOW_WIDTH_WIDE_MODE:int = 683; |
public static const NICO_VIDEO_WINDOW_WIDTH_WIDE_MODE:int = 640; |
| 166 |
|
|
| 167 |
|
public static const NICO_VIDEO_PADDING:int = 10; |
| 168 |
|
|
| 169 |
public static const WIDE_MODE_ASPECT_RATIO:Number = 1.7; |
public static const WIDE_MODE_ASPECT_RATIO:Number = 1.7; |
| 170 |
|
|
| 404 |
|
|
| 405 |
if(videoInfoView != null){ |
if(videoInfoView != null){ |
| 406 |
videoInfoView.resetInfo(); |
videoInfoView.resetInfo(); |
| 407 |
videoInfoView.restore(); |
// videoInfoView.restore(); |
| 408 |
} |
} |
| 409 |
|
|
| 410 |
videoPlayer.setControllerEnable(false); |
videoPlayer.setControllerEnable(false); |
| 584 |
|
|
| 585 |
videoPlayer.label_downloadStatus.text = ""; |
videoPlayer.label_downloadStatus.text = ""; |
| 586 |
videoInfoView.image_thumbImg.source = ""; |
videoInfoView.image_thumbImg.source = ""; |
| 587 |
videoPlayer.videoInfoView.text_info.htmlText ="(タイトルを取得中)<br />(投稿日時を取得中)<br />再生: コメント: マイリスト:" |
videoInfoView.text_info.htmlText ="(タイトルを取得中)<br />(投稿日時を取得中)<br />再生: コメント: マイリスト:" |
| 588 |
|
|
| 589 |
if(isStreamingPlay){ |
if(isStreamingPlay){ |
| 590 |
//最新の情報はDL済みなのでそれを使う |
//最新の情報はDL済みなのでそれを使う |
| 686 |
videoPlayer.videoController_under.button_play.setStyle("icon", icon_Pause); |
videoPlayer.videoController_under.button_play.setStyle("icon", icon_Pause); |
| 687 |
setVolume(videoPlayer.videoController.slider_volume.value); |
setVolume(videoPlayer.videoController.slider_volume.value); |
| 688 |
|
|
| 689 |
if(videoInfoView.visible){ |
// if(videoInfoView.visible){ |
| 690 |
videoInfoView.restore(); |
// videoInfoView.restore(); |
| 691 |
} |
// } |
| 692 |
if(videoPlayer.stage.displayState != StageDisplayState.FULL_SCREEN_INTERACTIVE){ |
if(videoPlayer.stage.displayState != StageDisplayState.FULL_SCREEN_INTERACTIVE){ |
| 693 |
videoPlayer.restore(); |
videoPlayer.restore(); |
| 694 |
} |
} |
| 695 |
|
|
| 696 |
if(videoInfoView.visible){ |
// if(videoInfoView.visible){ |
| 697 |
videoInfoView.activate(); |
// videoInfoView.activate(); |
| 698 |
} |
// } |
| 699 |
videoPlayer.activate(); |
videoPlayer.activate(); |
| 700 |
|
|
| 701 |
windowResized(false); |
windowResized(false); |
| 756 |
videoPlayer.videoController_under.button_play.setStyle("icon", icon_Pause); |
videoPlayer.videoController_under.button_play.setStyle("icon", icon_Pause); |
| 757 |
videoPlayer.videoController.button_play.setStyle("icon", icon_Pause); |
videoPlayer.videoController.button_play.setStyle("icon", icon_Pause); |
| 758 |
|
|
| 759 |
if(videoInfoView.visible){ |
// if(videoInfoView.visible){ |
| 760 |
videoInfoView.restore(); |
// videoInfoView.restore(); |
| 761 |
} |
// } |
| 762 |
|
|
| 763 |
if(videoPlayer.stage.displayState != StageDisplayState.FULL_SCREEN_INTERACTIVE){ |
if(videoPlayer.stage.displayState != StageDisplayState.FULL_SCREEN_INTERACTIVE){ |
| 764 |
videoPlayer.restore(); |
videoPlayer.restore(); |
| 765 |
} |
} |
| 766 |
|
|
| 767 |
if(videoInfoView.visible){ |
// if(videoInfoView.visible){ |
| 768 |
videoInfoView.activate(); |
// videoInfoView.activate(); |
| 769 |
} |
// } |
| 770 |
videoPlayer.activate(); |
videoPlayer.activate(); |
| 771 |
|
|
| 772 |
videoPlayer.setControllerEnable(true); |
videoPlayer.setControllerEnable(true); |
| 1211 |
*/ |
*/ |
| 1212 |
public function setVideoSmoothing(isSmoothing:Boolean):void{ |
public function setVideoSmoothing(isSmoothing:Boolean):void{ |
| 1213 |
|
|
| 1214 |
if(videoDisplay != null && videoDisplay.videoObject != null){ |
if (videoDisplay != null && videoDisplay.videoObject != null) |
| 1215 |
videoDisplay.videoObject.smoothing = isSmoothing; |
{ |
| 1216 |
|
|
| 1217 |
|
if (isSmoothing) |
| 1218 |
|
{ |
| 1219 |
|
// スムージングする |
| 1220 |
|
|
| 1221 |
|
if (videoDisplay.videoObject.videoWidth == videoDisplay.videoObject.width) |
| 1222 |
|
{ |
| 1223 |
|
// 動画がピクセル等倍で表示されている |
| 1224 |
|
if (videoInfoView.isSmoothingOnlyNotPixelIdenticalDimensions) |
| 1225 |
|
{ |
| 1226 |
|
// ピクセル等倍のときはスムージングしない |
| 1227 |
|
videoDisplay.videoObject.smoothing = false; |
| 1228 |
|
} |
| 1229 |
|
else |
| 1230 |
|
{ |
| 1231 |
|
// ピクセル等倍のときもスムージングする |
| 1232 |
|
videoDisplay.videoObject.smoothing = true; |
| 1233 |
|
} |
| 1234 |
|
} |
| 1235 |
|
else |
| 1236 |
|
{ |
| 1237 |
|
// 動画がピクセル等倍以外で表示されている |
| 1238 |
|
videoDisplay.videoObject.smoothing = true; |
| 1239 |
|
} |
| 1240 |
|
|
| 1241 |
|
} |
| 1242 |
|
else |
| 1243 |
|
{ |
| 1244 |
|
// スムージングしない |
| 1245 |
|
videoDisplay.videoObject.smoothing = false; |
| 1246 |
|
} |
| 1247 |
|
|
| 1248 |
} |
} |
| 1249 |
|
|
| 1250 |
} |
} |
| 1315 |
//FLV再生か? |
//FLV再生か? |
| 1316 |
|
|
| 1317 |
// スムージングを設定 |
// スムージングを設定 |
| 1318 |
|
this.setVideoSmoothing(videoInfoView.isSmoothing); |
|
this.videoDisplay.videoObject.smoothing = videoInfoView.isSmoothing; |
|
| 1319 |
|
|
| 1320 |
if(this.videoInfoView.selectedResizeType == VideoInfoView.RESIZE_TYPE_NICO && this.videoDisplay.videoObject.videoHeight > 0){ |
if(this.videoInfoView.selectedResizeType == VideoInfoView.RESIZE_TYPE_NICO && this.videoDisplay.videoObject.videoHeight > 0){ |
| 1321 |
|
|
| 1330 |
videoWindowHeight = PlayerController.NICO_VIDEO_WINDOW_HEIGHT * ratio; |
videoWindowHeight = PlayerController.NICO_VIDEO_WINDOW_HEIGHT * ratio; |
| 1331 |
if(this.videoInfoView.isEnableWideMode && isWideVideo){ |
if(this.videoInfoView.isEnableWideMode && isWideVideo){ |
| 1332 |
// logManager.addLog("ワイド(16:9)モード"); |
// logManager.addLog("ワイド(16:9)モード"); |
| 1333 |
videoWindowWidth = PlayerController.NICO_VIDEO_WINDOW_WIDTH_WIDE_MODE * ratio; |
videoWindowWidth = (PlayerController.NICO_VIDEO_WINDOW_WIDTH_WIDE_MODE + PlayerController.NICO_VIDEO_PADDING*2) * ratio; |
|
//動画そのものはセンターに表示 |
|
|
this.videoDisplay.setConstraintValue("left", (PlayerController.NICO_VIDEO_WINDOW_WIDTH - PlayerController.NICO_SWF_WIDTH)/2); |
|
|
this.videoDisplay.setConstraintValue("right", (PlayerController.NICO_VIDEO_WINDOW_WIDTH - PlayerController.NICO_SWF_WIDTH)/2); |
|
|
|
|
| 1334 |
}else{ |
}else{ |
| 1335 |
// logManager.addLog("ノーマル(4:3)モード"); |
// logManager.addLog("ノーマル(4:3)モード"); |
| 1336 |
videoWindowWidth = PlayerController.NICO_VIDEO_WINDOW_WIDTH * ratio; |
videoWindowWidth = (PlayerController.NICO_VIDEO_WINDOW_WIDTH + PlayerController.NICO_VIDEO_PADDING*2) * ratio; |
|
//動画そのものはセンターに表示 |
|
|
this.videoDisplay.setConstraintValue("left", (PlayerController.NICO_VIDEO_WINDOW_WIDTH - PlayerController.NICO_SWF_WIDTH)/2); |
|
|
this.videoDisplay.setConstraintValue("right", (PlayerController.NICO_VIDEO_WINDOW_WIDTH - PlayerController.NICO_SWF_WIDTH)/2); |
|
|
|
|
| 1337 |
} |
} |
| 1338 |
|
|
| 1339 |
|
//動画そのものはセンターに表示 |
| 1340 |
|
this.videoDisplay.setConstraintValue("left", PlayerController.NICO_VIDEO_PADDING); |
| 1341 |
|
this.videoDisplay.setConstraintValue("right", PlayerController.NICO_VIDEO_PADDING); |
| 1342 |
|
|
| 1343 |
|
trace(videoDisplay.width + "," + videoDisplay.height); |
| 1344 |
|
|
| 1345 |
if(videoDisplay.hasEventListener(LoadEvent.BYTES_LOADED_CHANGE)){ |
if(videoDisplay.hasEventListener(LoadEvent.BYTES_LOADED_CHANGE)){ |
| 1346 |
//init後の初回の大きさ合わせが出来れば良いので以降のシークでは呼ばれないようにする |
//init後の初回の大きさ合わせが出来れば良いので以降のシークでは呼ばれないようにする |
| 1347 |
videoDisplay.removeEventListener(LoadEvent.BYTES_LOADED_CHANGE, byteloadedChangedEventHandler); |
videoDisplay.removeEventListener(LoadEvent.BYTES_LOADED_CHANGE, byteloadedChangedEventHandler); |
| 1411 |
//FLV再生か? |
//FLV再生か? |
| 1412 |
|
|
| 1413 |
// スムージングを設定 |
// スムージングを設定 |
| 1414 |
this.videoDisplay.videoObject.smoothing = videoInfoView.isSmoothing; |
this.setVideoSmoothing(videoInfoView.isSmoothing); |
| 1415 |
|
|
| 1416 |
if(videoDisplay.hasEventListener(LoadEvent.BYTES_LOADED_CHANGE)){ |
if(videoDisplay.hasEventListener(LoadEvent.BYTES_LOADED_CHANGE)){ |
| 1417 |
//init後の初回の大きさ合わせが出来れば良いので以降のシークでは呼ばれないようにする |
//init後の初回の大きさ合わせが出来れば良いので以降のシークでは呼ばれないようにする |