aboutsummaryrefslogtreecommitdiffstats
path: root/nicolist.js
diff options
context:
space:
mode:
authorebith2015-05-30 23:46:50 +0900
committerebith2015-05-30 23:46:50 +0900
commit131dafe6f6e712036147cc065e51520d6e77af3c (patch)
tree7b17a752b6fc47415e1d73d30cedd62e022fcf7e /nicolist.js
parent4793ce6f8c78ca84b5182a335af3754f0e538ae5 (diff)
downloadvimperator-plugins-131dafe6f6e712036147cc065e51520d6e77af3c.tar.bz2
音量を調節するコマンドを追加
Diffstat (limited to 'nicolist.js')
-rw-r--r--nicolist.js21
1 files changed, 20 insertions, 1 deletions
diff --git a/nicolist.js b/nicolist.js
index 40f8414..c8e8294 100644
--- a/nicolist.js
+++ b/nicolist.js
@@ -43,6 +43,25 @@ commands.addUserCommand(
{
subCommands: [
new Command(
+ ['v[olume]'],
+ '音量を調節する',
+ function (args) {
+ if (/^(\+|-)/.test(args.literalArg)) {
+ video.container.volume += args.literalArg * 0.1
+ } else {
+ video.container.volume = args.literalArg * 0.1
+ }
+ },
+ {
+ literal: 0,
+ completer: function(context, args) {
+ context.filters = [CompletionContext.Filter.textDescription];
+ context.title = ['volume']
+ context.completions = [['', (video.container.volume * 10) + '/10']]
+ }
+ }
+ ),
+ new Command(
['a[dd]'],
'マイリストに追加する',
function (args) {
@@ -79,7 +98,7 @@ commands.addUserCommand(
let i = 0;
video.container = document.createElementNS('http://www.w3.org/1999/xhtml', 'video');
- video.container.volume = 0.7; // 効いてない
+ video.container.volume = 0.5;
video.container.autoplay = true;
['error', 'ended'].forEach(function(event) {
video.container.addEventListener(event, function() {