From efd65d3d0dc2b7e156e17ded99f59b70c45b1221 Mon Sep 17 00:00:00 2001 From: anekos Date: Mon, 22 Feb 2010 11:11:28 +0000 Subject: 自動フルスクリーンの修正&改良 git-svn-id: http://svn.coderepos.org/share/lang/javascript/vimperator-plugins/trunk@36849 d0d07461-0603-4401-acd4-de1884942a52 --- stella.js | 27 +++++++++++++++++---------- 1 file changed, 17 insertions(+), 10 deletions(-) diff --git a/stella.js b/stella.js index 87ba06e..0d638a5 100644 --- a/stella.js +++ b/stella.js @@ -39,7 +39,7 @@ let PLUGIN_INFO = すてら For Niconico/YouTube/Vimeo, Add control commands and information display(on status line). ニコニコ動画/YouTube/Vimeo 用。操作コマンドと情報表示(ステータスライン上に)追加します。 - 0.24.6 + 0.24.7 anekos new BSD License (Please read the source code comments of this plugin) 修正BSDライセンス (ソースコードのコメントを参照してください) @@ -258,9 +258,6 @@ TODO ・上書き保存 ・Fx の pref と liberator.globalVariables の両方で設定をできるようにする (Setting) -FIXME - ・this.last.fullscreen = value; - MEMO ・prototype での定義順: 単純な値 initialize finalize (get|set)ter メソッド ・関数やプロパティは基本的にアルファベット順にならべる。 @@ -488,7 +485,7 @@ Thanks: function Setting () { this.niconico = { - autoFullscreenDelay: 4000 + autoFullscreenDelay: 1000 }; } @@ -506,7 +503,7 @@ Thanks: this.stella = stella; this.last = { - fullscreen: false + screenMode: null }; function setf (name, value) @@ -821,7 +818,7 @@ Thanks: ); } - this.last.fullscreen = value; + this.last.screenMode = value ? 'fullscreen' : null; this.storage.fullscreen = value; // changeOuterNodes(value); @@ -1042,7 +1039,15 @@ Thanks: get playerContainer () U.getElementByIdEx('flvplayer_container'), - get ready () !!(this.player && this.player.ext_getVideoSize), + get ready () { + try { + if (!this.player) + return false; + return this.player.ext_getLoadedRatio() > 0.0 + } catch (e) { + return false; + } + }, get relations () { let self = this; @@ -1129,6 +1134,8 @@ Thanks: if (!value && typeof pos != "undefined") setTimeout(function () buffer.scrollTo(pos.x, pos.y), 0); + this.last.screenMode = this.large ? 'large' : null; + return this.large; }, @@ -1848,7 +1855,7 @@ Thanks: onPlayClick: function () this.player.play(), onReady: function () { - if (this.player.last.fullscreen && !this.storage.alreadyAutoFullscreen + if (this.player.last.screenMode && !this.storage.alreadyAutoFullscreen && !this.__autoFullscreenTimer) { this.__autoFullscreenTimer = setInterval( U.bindr(this, function () { @@ -1856,7 +1863,7 @@ Thanks: return; clearInterval(this.__autoFullscreenTimer) setTimeout( - U.bindr(this, function () (this.player.fullscreen = true)), + U.bindr(this, function () (this.player[this.player.last.screenMode] = true)), this.setting.niconico.autoFullscreenDelay ); delete this.__autoFullscreenTimer; -- cgit v1.2.3