From 131dafe6f6e712036147cc065e51520d6e77af3c Mon Sep 17 00:00:00 2001 From: ebith Date: Sat, 30 May 2015 23:46:50 +0900 Subject: 音量を調節するコマンドを追加 --- nicolist.js | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/nicolist.js b/nicolist.js index 40f8414..c8e8294 100644 --- a/nicolist.js +++ b/nicolist.js @@ -42,6 +42,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]'], 'マイリストに追加する', @@ -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() { -- cgit v1.2.3