Changeset 29531
- Timestamp:
- 02/04/09 20:49:59 (4 years ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
lang/javascript/vimperator-plugins/trunk/stella.js
r29525 r29531 114 114 TODO 115 115 ・Icons 116 ・Other video hosting websites117 116 ・auto fullscreen 118 117 ・動的な command の追加削除 (nice rabbit!) … … 121 120 ・argCount の指定が適当なのを修正 (動的な userCommand と平行でうまくできそう?) 122 121 ・実際のプレイヤーが表示されるまで待機できようにしたい(未表示に時にフルスクリーン化すると…) 123 ・コメント欄でリンクされている動画も関連動画として扱いたい124 -> "その3=>sm666" みたいなやつ125 -> リンクはともかくタイトルの取得がムツカシー126 122 ・isValid とは別にプレイヤーの準備が出来ているか?などをチェックできる関数があるほうがいいかも 127 123 -> isValid ってなまえはどうなの? 128 124 -> isReady とか 129 125 ・パネルなどの要素にクラス名をつける 126 127 FIXME 128 ・this.last.fullscreen = value; 130 129 131 130 MEMO … … 352 351 353 352 this.initialize.apply(this, arguments); 353 354 this.last = { 355 fullscreen: false 356 }; 354 357 355 358 function setf (name, value) … … 443 446 get fileURL () undefined, 444 447 448 get large () this.fullscreen, 449 set large (value) (this.fullscreen = value), 450 445 451 get maxVolume () 100, 446 452 447 453 get muted () undefined, 448 454 set muted (value) value, 455 456 get ready () undefined, 449 457 450 458 get relatedIDs () undefined, … … 463 471 get repeating () undefined, 464 472 set repeating (value) value, 465 466 get large () this.fullscreen,467 set large (value) (this.fullscreen = value),468 473 469 474 get state () undefined, … … 656 661 function (id) { 657 662 let (node = U.getElementById(id)) { 658 liberator.log(node)659 663 node && f(node); 660 664 } … … 663 667 } 664 668 669 this.last.fullscreen = value; 665 670 this.storage.fullscreen = value; 666 671 … … 690 695 get player () 691 696 U.getElementByIdEx('movie_player'), 697 698 get ready () !!this.player, 692 699 693 700 get relatedIDs () { … … 821 828 set comment (value) (this.player.ext_setCommentVisible(value), value), 822 829 823 get currentTime () parseInt(this.player.ext_getPlayheadTime()), 830 get currentTime () { 831 try { 832 return parseInt(this.player.ext_getPlayheadTime()) 833 } catch (e) { 834 liberator.log(e) 835 liberator.log(e.stack) 836 } 837 }, 824 838 set currentTime (value) (this.player.ext_setPlayheadTime(U.fromTimeCode(value)), this.currentTime), 825 839 … … 896 910 ((InVimperator && liberator.mode === modes.COMMAND_LINE) || setTimeout(turnOnMain, 500)); 897 911 912 this.last.fullscreen = value; 913 898 914 // メイン 899 915 value = !!value; … … 923 939 924 940 get playerContainer () U.getElementByIdEx('flvplayer_container'), 941 942 get ready () !!(this.player && this.player.ext_getVideoSize), 925 943 926 944 get relatedIDs () { … … 957 975 .filter(function (it) /watch\//.test(it.href)) 958 976 .map(function(v) v.textContent); 959 liberator.log(comment)960 977 links.forEach(function (link) { 961 978 let r = RegExp('(?:^|[\u3000\\s\\>])([^\u3000\\s\\>]+)\\s*<a href="http:\\/\\/www\\.nicovideo\\.\\w+\\/watch\\/' + link + '" class="video">').exec(comment); … … 1424 1441 disable: function () { 1425 1442 this.hidden = true; 1426 if (this.timerHandle) { 1427 clearInterval(this.timerHandle); 1428 this.timerHandle = null; 1443 if (this.__updateTimer) { 1444 clearInterval(this.__updateTimer); 1445 delete this.__updateTimer; 1446 } 1447 if (this.__autoFullscreenTimer) { 1448 clearInterval(this.__autoFullscreenTimer); 1429 1449 } 1430 1450 }, … … 1436 1456 this.toggles[name].hidden = !this.player.has(name, 't'); 1437 1457 } 1438 if (!this. timerHandle) {1439 this. timerHandle= setInterval(U.bindr(this, this.update), 500);1458 if (!this.__updateTimer) { 1459 this.__updateTimer = setInterval(U.bindr(this, this.update), 500); 1440 1460 } 1441 1461 }, … … 1448 1468 1449 1469 update: function () { 1470 if (!(this.isValid && this.player.ready)) 1471 return; 1450 1472 this.labels.main.text = this.player.statusText; 1451 1473 this.labels.volume.text = this.player.volume; … … 1480 1502 (this.__valid = this.isValid) ? this.enable() : this.disable(); 1481 1503 } 1504 if (this.isValid) { 1505 clearInterval(this.__onReadyTimer); 1506 this.__onReadyTimer = setInterval( 1507 U.bindr(this, function () { 1508 if (this.player && this.player.ready) { 1509 clearInterval(this.__onReadyTimer); 1510 delete this.__onReadyTimer; 1511 this.onReady(); 1512 } 1513 }), 1514 200 1515 ); 1516 } 1482 1517 }, 1483 1518 … … 1499 1534 1500 1535 onPlayClick: function () this.player.play(), 1536 1537 onReady: function () { 1538 if (this.player.last.fullscreen && !this.__autoFullscreenTimer) { 1539 this.__autoFullscreenTimer = setInterval( 1540 U.bindr(this, function () { 1541 if (!this.player.ready) 1542 return; 1543 clearInterval(this.__autoFullscreenTimer) 1544 setTimeout(U.bindr(this, function () (this.player.fullscreen = true), 1000)); 1545 delete this.__autoFullscreenTimer; 1546 }), 1547 200 1548 ); 1549 } 1550 }, 1501 1551 1502 1552 onRepeatClick: function () this.player.toggle('repeating'),
![(please configure the [header_logo] section in trac.ini)](/share/chrome/site/your_project_logo.png)