2018-12-30 23:16:09 +01:00
|
|
|
import Debug from './Debug';
|
|
|
|
import currentBrowser from './BrowserDetect';
|
2019-01-20 22:59:06 +01:00
|
|
|
import VideoAlignment from '../../common/enums/video-alignment.enum';
|
|
|
|
import Stretch from '../../common/enums/stretch.enum';
|
|
|
|
import ExtensionMode from '../../common/enums/extension-mode.enum';
|
2019-02-21 21:51:35 +01:00
|
|
|
import AntiGradientMode from '../../common/enums/anti-gradient-mode.enum';
|
2019-03-10 23:27:50 +01:00
|
|
|
import AspectRatio from '../../common/enums/aspect-ratio.enum';
|
2019-10-24 23:27:43 +02:00
|
|
|
import CropModePersistence from '../../common/enums/crop-mode-persistence.enum';
|
2018-12-30 23:16:09 +01:00
|
|
|
|
2018-03-13 23:55:38 +01:00
|
|
|
if(Debug.debug)
|
|
|
|
console.log("Loading: ExtensionConf.js");
|
2017-12-17 22:56:07 +01:00
|
|
|
|
2018-03-13 23:55:38 +01:00
|
|
|
var ExtensionConf = {
|
|
|
|
arDetect: {
|
2018-05-04 00:27:40 +02:00
|
|
|
disabledReason: "", // if automatic aspect ratio has been disabled, show reason
|
2018-03-13 23:55:38 +01:00
|
|
|
allowedMisaligned: 0.05, // top and bottom letterbox thickness can differ by this much.
|
|
|
|
// Any more and we don't adjust ar.
|
|
|
|
allowedArVariance: 0.075, // amount by which old ar can differ from the new (1 = 100%)
|
2019-01-26 17:52:50 +01:00
|
|
|
timers: { // autodetection frequency
|
2019-06-02 03:00:07 +02:00
|
|
|
playing: 333, // while playing
|
2019-01-26 17:52:50 +01:00
|
|
|
paused: 3000, // while paused
|
|
|
|
error: 3000, // after error
|
|
|
|
minimumTimeout: 5,
|
2019-06-02 23:49:48 +02:00
|
|
|
tickrate: 10, // 1 tick every this many milliseconds
|
2019-01-26 17:52:50 +01:00
|
|
|
},
|
2018-05-04 00:27:40 +02:00
|
|
|
autoDisable: { // settings for automatically disabling the extension
|
2018-06-27 23:55:37 +02:00
|
|
|
maxExecutionTime: 6000, // if execution time of main autodetect loop exceeds this many milliseconds,
|
2018-05-04 00:27:40 +02:00
|
|
|
// we disable it.
|
2018-07-11 00:01:44 +02:00
|
|
|
consecutiveTimeoutCount: 5, // we only do it if it happens this many consecutive times
|
|
|
|
|
|
|
|
// FOR FUTURE USE
|
|
|
|
consecutiveArResets: 5 // if aspect ratio reverts immediately after AR change is applied, we disable everything
|
2018-05-04 00:27:40 +02:00
|
|
|
},
|
2019-02-15 00:00:22 +01:00
|
|
|
canvasDimensions: {
|
|
|
|
blackframeCanvas: { // smaller than sample canvas, blackframe canvas is used to recon for black frames
|
|
|
|
// it's not used to detect aspect ratio by itself, so it can be tiny af
|
|
|
|
width: 16,
|
|
|
|
height: 9,
|
|
|
|
},
|
|
|
|
sampleCanvas: { // size of image sample for detecting aspect ratio. Bigger size means more accurate results,
|
|
|
|
// at the expense of performance
|
|
|
|
width: 640,
|
|
|
|
height: 360,
|
|
|
|
},
|
2019-01-26 17:52:50 +01:00
|
|
|
},
|
2019-02-15 00:00:22 +01:00
|
|
|
|
2018-05-15 20:36:22 +02:00
|
|
|
// samplingInterval: 10, // we sample at columns at (width/this) * [ 1 .. this - 1]
|
2019-02-15 00:00:22 +01:00
|
|
|
blackframe: {
|
2019-05-05 00:09:49 +02:00
|
|
|
sufficientColorVariance: 0.10, // calculate difference between average intensity and pixel, for every pixel for every color
|
2019-05-03 00:49:33 +02:00
|
|
|
// component. Average intensity is normalized to where 0 is black and 1 is biggest value for
|
|
|
|
// that component. If sum of differences between normalized average intensity and normalized
|
|
|
|
// component varies more than this % between color components, we can afford to use less strict
|
|
|
|
// cummulative treshold.
|
2019-05-04 21:33:48 +02:00
|
|
|
cumulativeThresholdLax: 1600,
|
2019-05-03 00:49:33 +02:00
|
|
|
cumulativeThresholdStrict: 2560,// if we add values of all pixels together and get more than this, the frame is bright enough.
|
2019-02-22 23:02:48 +01:00
|
|
|
// (note: blackframe is 16x9 px -> 144px total. cumulative threshold can be reached fast)
|
2019-02-15 00:00:22 +01:00
|
|
|
blackPixelsCondition: 0.6, // How much pixels must be black (1 all, 0 none) before we consider frame as black. Takes
|
2019-02-22 23:02:48 +01:00
|
|
|
// precedence over cumulative threshold: if blackPixelsCondition is met, the frame is dark
|
|
|
|
// regardless of whether cumulative threshold has been reached.
|
2019-02-15 00:00:22 +01:00
|
|
|
},
|
2019-01-26 17:52:50 +01:00
|
|
|
blackbar: {
|
|
|
|
blackLevel: 10, // everything darker than 10/255 across all RGB components is considered black by
|
2018-08-20 22:45:43 +02:00
|
|
|
// default. blackLevel can decrease if we detect darker black.
|
2019-05-02 22:43:40 +02:00
|
|
|
threshold: 16, // if pixel is darker than the sum of black level and this value, we count it as black
|
2018-03-13 23:55:38 +01:00
|
|
|
// on 0-255. Needs to be fairly high (8 might not cut it) due to compression
|
|
|
|
// artifacts in the video itself
|
2019-05-04 21:33:48 +02:00
|
|
|
frameThreshold: 4, // treshold, but when doing blackframe test
|
2019-05-02 22:43:40 +02:00
|
|
|
imageThreshold: 16, // in order to detect pixel as "not black", the pixel must be brighter than
|
2019-02-22 23:02:48 +01:00
|
|
|
// the sum of black level, threshold and this value.
|
2019-05-02 22:43:40 +02:00
|
|
|
gradientThreshold: 2, // When trying to determine thickness of the black bars, we take 2 values: position of
|
2019-02-22 23:02:48 +01:00
|
|
|
// the last pixel that's darker than our threshold, and position of the first pixel that's
|
|
|
|
// brighter than our image threshold. If positions are more than this many pixels apart,
|
2019-01-26 17:52:50 +01:00
|
|
|
// we assume we aren't looking at letterbox and thus don't correct the aspect ratio.
|
2019-05-02 22:43:40 +02:00
|
|
|
gradientSampleSize: 16, // How far do we look to find the gradient
|
|
|
|
maxGradient: 6, // if two neighbouring pixels in gradientSampleSize differ by more than this, then we aren't
|
|
|
|
// looking at a gradient
|
|
|
|
gradientNegativeTreshold: -2,
|
|
|
|
gradientMaxSD: 6, // reserved for future use
|
|
|
|
antiGradientMode: AntiGradientMode.Lax,
|
2019-01-26 17:52:50 +01:00
|
|
|
},
|
2019-02-22 23:02:48 +01:00
|
|
|
variableBlackbarThresholdOptions: { // In case of poor bitrate videos, jpeg artifacts may cause us issues
|
2018-07-11 00:01:44 +02:00
|
|
|
// FOR FUTURE USE
|
|
|
|
enabled: true, // allow increasing blackbar threshold
|
2019-02-22 23:02:48 +01:00
|
|
|
disableArDetectOnMax: true, // disable autodetection when threshold goes over max blackbar threshold
|
|
|
|
maxBlackbarThreshold: 48, // max threshold (don't increase past this)
|
|
|
|
thresholdStep: 8, // when failing to set aspect ratio, increase threshold by this much
|
2018-07-11 00:01:44 +02:00
|
|
|
increaseAfterConsecutiveResets: 2 // increase if AR resets this many times in a row
|
|
|
|
},
|
2019-01-26 17:52:50 +01:00
|
|
|
sampling: {
|
|
|
|
staticCols: 9, // we take a column at [0-n]/n-th parts along the width and sample it
|
|
|
|
randomCols: 0, // we add this many randomly selected columns to the static columns
|
|
|
|
staticRows: 9, // forms grid with staticSampleCols. Determined in the same way. For black frame checks
|
|
|
|
},
|
2018-03-13 23:55:38 +01:00
|
|
|
guardLine: { // all pixels on the guardline need to be black, or else we trigger AR recalculation
|
|
|
|
// (if AR fails to be recalculated, we reset AR)
|
|
|
|
enabled: true,
|
|
|
|
ignoreEdgeMargin: 0.20, // we ignore anything that pokes over the black line this close to the edge
|
|
|
|
// (relative to width of the sample)
|
2019-02-22 23:02:48 +01:00
|
|
|
imageTestThreshold: 0.1, // when testing for image, this much pixels must be over blackbarThreshold
|
2018-05-16 23:26:47 +02:00
|
|
|
edgeTolerancePx: 2, // black edge violation is performed this far from reported 'last black pixel'
|
2018-03-13 23:55:38 +01:00
|
|
|
edgeTolerancePercent: null // unused. same as above, except use % of canvas height instead of pixels
|
|
|
|
},
|
2018-03-18 15:14:57 +01:00
|
|
|
fallbackMode: {
|
2019-01-26 17:52:50 +01:00
|
|
|
enabled: true,
|
2018-03-18 15:14:57 +01:00
|
|
|
safetyBorderPx: 5, // determines the thickness of safety border in fallback mode
|
|
|
|
noTriggerZonePx: 8 // if we detect edge less than this many pixels thick, we don't correct.
|
|
|
|
},
|
2018-03-13 23:55:38 +01:00
|
|
|
arSwitchLimiter: { // to be implemented
|
|
|
|
switches: 2, // we can switch this many times
|
|
|
|
period: 2.0 // per this period
|
|
|
|
},
|
|
|
|
edgeDetection: {
|
|
|
|
sampleWidth: 8, // we take a sample this wide for edge detection
|
2019-02-22 23:02:48 +01:00
|
|
|
detectionThreshold: 4, // sample needs to have this many non-black pixels to be a valid edge
|
2019-06-02 00:34:37 +02:00
|
|
|
confirmationThreshold: 1, //
|
2019-06-02 02:44:02 +02:00
|
|
|
singleSideConfirmationThreshold: 3, // we need this much edges (out of all samples, not just edges) in order
|
2018-03-13 23:55:38 +01:00
|
|
|
// to confirm an edge in case there's no edges on top or bottom (other
|
|
|
|
// than logo, of course)
|
2019-02-22 23:02:48 +01:00
|
|
|
logoThreshold: 0.15, // if edge candidate sits with count greater than this*all_samples, it can't be logo
|
2018-03-13 23:55:38 +01:00
|
|
|
// or watermark.
|
2019-01-26 17:52:50 +01:00
|
|
|
edgeTolerancePx: 1, // we check for black edge violation this far from detection point
|
2018-03-13 23:55:38 +01:00
|
|
|
edgeTolerancePercent: null, // we check for black edge detection this % of height from detection point. unused
|
|
|
|
middleIgnoredArea: 0.2, // we ignore this % of canvas height towards edges while detecting aspect ratios
|
|
|
|
minColsForSearch: 0.5, // if we hit the edge of blackbars for all but this many columns (%-wise), we don't
|
|
|
|
// continue with search. It's pointless, because black edge is higher/lower than we
|
|
|
|
// are now. (NOTE: keep this less than 1 in case we implement logo detection)
|
2018-04-11 00:19:44 +02:00
|
|
|
},
|
|
|
|
pillarTest: {
|
|
|
|
ignoreThinPillarsPx: 5, // ignore pillars that are less than this many pixels thick.
|
|
|
|
allowMisaligned: 0.05 // left and right edge can vary this much (%)
|
|
|
|
},
|
|
|
|
textLineTest: {
|
|
|
|
nonTextPulse: 0.10, // if a single continuous pulse has this many non-black pixels, we aren't dealing
|
|
|
|
// with text. This value is relative to canvas width (%)
|
2019-02-22 23:02:48 +01:00
|
|
|
pulsesToConfirm: 10, // this is a threshold to confirm we're seeing text.
|
|
|
|
pulsesToConfirmIfHalfBlack: 5, // this is the threshold to confirm we're seeing text if longest black pulse
|
2018-04-11 00:19:44 +02:00
|
|
|
// is over 50% of the canvas width
|
|
|
|
testRowOffset: 0.02 // we test this % of height from detected edge
|
2018-03-13 23:55:38 +01:00
|
|
|
}
|
|
|
|
},
|
2018-09-21 00:26:08 +02:00
|
|
|
zoom: {
|
|
|
|
minLogZoom: -1,
|
|
|
|
maxLogZoom: 3,
|
|
|
|
announceDebounce: 200 // we wait this long before announcing new zoom
|
|
|
|
},
|
2018-12-03 00:31:28 +01:00
|
|
|
miscSettings: {
|
2018-09-17 00:39:32 +02:00
|
|
|
mousePan: {
|
|
|
|
enabled: false
|
|
|
|
},
|
2018-12-03 00:31:28 +01:00
|
|
|
mousePanReverseMouse: false,
|
2018-03-13 23:55:38 +01:00
|
|
|
},
|
2018-05-12 02:51:58 +02:00
|
|
|
stretch: {
|
|
|
|
conditionalDifferencePercent: 0.05 // black bars less than this wide will trigger stretch
|
|
|
|
// if mode is set to '1'. 1.0=100%
|
|
|
|
},
|
2018-05-13 15:22:28 +02:00
|
|
|
resizer: {
|
|
|
|
setStyleString: {
|
|
|
|
maxRetries: 3,
|
|
|
|
retryTimeout: 200
|
|
|
|
}
|
|
|
|
},
|
2018-05-21 22:43:56 +02:00
|
|
|
pageInfo: {
|
|
|
|
timeouts: {
|
|
|
|
urlCheck: 200,
|
|
|
|
rescan: 1500
|
|
|
|
}
|
|
|
|
},
|
2018-06-27 23:55:37 +02:00
|
|
|
// -----------------------------------------
|
2018-11-14 23:32:37 +01:00
|
|
|
// ::: ACTIONS :::
|
|
|
|
// -----------------------------------------
|
|
|
|
// Nastavitve za ukaze. Zamenja stare nastavitve za bližnične tipke.
|
|
|
|
//
|
|
|
|
// Polje 'shortcut' je tabela, če se slučajno lotimo kdaj delati choordov.
|
|
|
|
actions: [{
|
2018-12-30 23:16:09 +01:00
|
|
|
name: 'Trigger automatic detection', // name displayed in settings
|
|
|
|
label: 'Automatic', // name displayed in ui (can be overriden in scope/playerUi)
|
2018-11-14 23:32:37 +01:00
|
|
|
cmd: [{
|
2018-11-18 03:29:16 +01:00
|
|
|
action: 'set-ar',
|
2019-03-10 23:27:50 +01:00
|
|
|
arg: AspectRatio.Automatic,
|
2018-11-26 23:44:37 +01:00
|
|
|
persistent: false, // optional, false by default. If true, change doesn't take effect immediately.
|
|
|
|
// Instead, this action saves stuff to settings
|
2018-11-14 23:32:37 +01:00
|
|
|
}],
|
2018-12-30 23:16:09 +01:00
|
|
|
scopes: {
|
|
|
|
global: { // if 'global' is undefined, 'show' is presumed to be 'false'
|
|
|
|
show: false,
|
|
|
|
},
|
|
|
|
site: {
|
|
|
|
show: false,
|
|
|
|
},
|
|
|
|
page: {
|
|
|
|
show: true,
|
|
|
|
label: 'Automatic', // example override, takes precedence over default label
|
|
|
|
shortcut: [{
|
|
|
|
key: 'a',
|
2019-10-23 19:34:58 +02:00
|
|
|
code: 'KeyA',
|
2018-12-30 23:16:09 +01:00
|
|
|
ctrlKey: false,
|
|
|
|
metaKey: false,
|
|
|
|
altKey: false,
|
|
|
|
shiftKey: false,
|
|
|
|
onKeyUp: true,
|
|
|
|
onKeyDown: false,
|
|
|
|
}],
|
|
|
|
}
|
|
|
|
},
|
|
|
|
playerUi: {
|
|
|
|
show: true,
|
|
|
|
path: 'crop',
|
|
|
|
},
|
2019-10-23 19:34:58 +02:00
|
|
|
}, {
|
2018-12-30 23:16:09 +01:00
|
|
|
name: 'Reset to default',
|
|
|
|
label: 'Reset',
|
2018-11-14 23:32:37 +01:00
|
|
|
cmd: [{
|
2018-11-18 03:29:16 +01:00
|
|
|
action: 'set-ar',
|
2019-03-10 23:27:50 +01:00
|
|
|
arg: AspectRatio.Reset,
|
2018-11-14 23:32:37 +01:00
|
|
|
}],
|
2018-12-30 23:16:09 +01:00
|
|
|
scopes: {
|
|
|
|
page: {
|
|
|
|
show: true,
|
|
|
|
shortcut: [{
|
|
|
|
key: 'r',
|
2019-10-23 19:34:58 +02:00
|
|
|
code: 'KeyR',
|
2018-12-30 23:16:09 +01:00
|
|
|
ctrlKey: false,
|
|
|
|
metaKey: false,
|
|
|
|
altKey: false,
|
|
|
|
shiftKey: false,
|
|
|
|
onKeyUp: true,
|
|
|
|
onKeyDown: false,
|
|
|
|
}],
|
|
|
|
}
|
|
|
|
},
|
|
|
|
playerUi: {
|
|
|
|
show: true,
|
|
|
|
path: 'crop'
|
|
|
|
},
|
2019-10-23 19:34:58 +02:00
|
|
|
}, {
|
2018-12-30 23:16:09 +01:00
|
|
|
name: 'Fit to width',
|
|
|
|
label: 'Fit width',
|
2018-11-14 23:32:37 +01:00
|
|
|
cmd: [{
|
2018-11-18 03:29:16 +01:00
|
|
|
action: 'set-ar',
|
2019-03-10 23:27:50 +01:00
|
|
|
arg: AspectRatio.FitWidth,
|
2018-11-14 23:32:37 +01:00
|
|
|
}],
|
2018-12-30 23:16:09 +01:00
|
|
|
scopes: {
|
|
|
|
page: {
|
|
|
|
show: true,
|
|
|
|
shortcut: [{
|
|
|
|
key: 'w',
|
2019-10-23 19:34:58 +02:00
|
|
|
code: 'KeyW',
|
2018-12-30 23:16:09 +01:00
|
|
|
ctrlKey: false,
|
|
|
|
metaKey: false,
|
|
|
|
altKey: false,
|
|
|
|
shiftKey: false,
|
|
|
|
onKeyUp: true,
|
|
|
|
onKeyDown: false,
|
|
|
|
}],
|
|
|
|
}
|
|
|
|
},
|
|
|
|
playerUi: {
|
|
|
|
show: true,
|
|
|
|
path: 'crop'
|
|
|
|
}
|
2019-10-23 19:34:58 +02:00
|
|
|
}, {
|
2018-12-30 23:16:09 +01:00
|
|
|
name: 'Fit to height',
|
|
|
|
label: 'Fit height',
|
2018-11-14 23:32:37 +01:00
|
|
|
cmd: [{
|
2018-11-18 03:29:16 +01:00
|
|
|
action: 'set-ar',
|
2019-03-10 23:27:50 +01:00
|
|
|
arg: AspectRatio.FitHeight
|
2018-11-14 23:32:37 +01:00
|
|
|
}],
|
2018-12-30 23:16:09 +01:00
|
|
|
scopes: {
|
|
|
|
page: {
|
|
|
|
show: true,
|
|
|
|
shortcut: [{
|
|
|
|
key: 'e',
|
2019-10-23 19:34:58 +02:00
|
|
|
code: 'KeyE',
|
2018-12-30 23:16:09 +01:00
|
|
|
ctrlKey: false,
|
|
|
|
metaKey: false,
|
|
|
|
altKey: false,
|
|
|
|
shiftKey: false,
|
|
|
|
onKeyUp: true,
|
|
|
|
onKeyDown: false,
|
|
|
|
}]
|
|
|
|
}
|
|
|
|
},
|
|
|
|
playerUi: {
|
|
|
|
show: true,
|
|
|
|
path: 'crop'
|
|
|
|
}
|
2019-10-23 19:34:58 +02:00
|
|
|
}, {
|
2019-12-06 00:17:09 +01:00
|
|
|
userAdded: true,
|
2018-12-30 23:16:09 +01:00
|
|
|
name: 'Set aspect ratio to 16:9',
|
|
|
|
label: '16:9',
|
2018-11-14 23:32:37 +01:00
|
|
|
cmd: [{
|
2018-11-18 03:29:16 +01:00
|
|
|
action: 'set-ar',
|
2019-03-10 23:27:50 +01:00
|
|
|
arg: AspectRatio.Fixed,
|
|
|
|
customArg: 1.78,
|
2018-11-14 23:32:37 +01:00
|
|
|
}],
|
2018-12-30 23:16:09 +01:00
|
|
|
scopes: {
|
|
|
|
page: {
|
|
|
|
show: true,
|
|
|
|
shortcut: [{
|
|
|
|
key: 's',
|
2019-10-23 19:34:58 +02:00
|
|
|
code: 'KeyS',
|
2018-12-30 23:16:09 +01:00
|
|
|
ctrlKey: false,
|
|
|
|
metaKey: false,
|
|
|
|
altKey: false,
|
|
|
|
shiftKey: false,
|
|
|
|
onKeyUp: false,
|
|
|
|
onKeyDown: true,
|
|
|
|
}],
|
|
|
|
}
|
|
|
|
},
|
|
|
|
playerUi: {
|
|
|
|
show: true,
|
|
|
|
path: 'crop'
|
|
|
|
}
|
2019-10-23 19:34:58 +02:00
|
|
|
}, {
|
2019-12-06 00:17:09 +01:00
|
|
|
userAdded: true,
|
2018-12-30 23:16:09 +01:00
|
|
|
name: 'Set aspect ratio to 21:9 (2.39:1)',
|
|
|
|
label: '21:9',
|
2018-11-14 23:32:37 +01:00
|
|
|
cmd: [{
|
2018-11-18 03:29:16 +01:00
|
|
|
action: 'set-ar',
|
2019-03-10 23:27:50 +01:00
|
|
|
arg: AspectRatio.Fixed,
|
|
|
|
customArg: 2.39
|
2018-11-14 23:32:37 +01:00
|
|
|
}],
|
2018-12-30 23:16:09 +01:00
|
|
|
scopes: {
|
|
|
|
page: {
|
|
|
|
show: true,
|
|
|
|
shortcut: [{
|
|
|
|
key: 'd',
|
2019-10-23 19:34:58 +02:00
|
|
|
code: 'KeyD',
|
2018-12-30 23:16:09 +01:00
|
|
|
ctrlKey: false,
|
|
|
|
metaKey: false,
|
|
|
|
altKey: false,
|
|
|
|
shiftKey: false,
|
|
|
|
onKeyUp: false,
|
|
|
|
onKeyDown: true,
|
|
|
|
}]
|
|
|
|
}
|
|
|
|
},
|
|
|
|
playerUi: {
|
|
|
|
show: true,
|
|
|
|
path: 'crop'
|
|
|
|
}
|
2019-10-23 19:34:58 +02:00
|
|
|
}, {
|
2019-12-06 00:17:09 +01:00
|
|
|
userAdded: true,
|
2018-12-30 23:16:09 +01:00
|
|
|
name: 'Set aspect ratio to 18:9',
|
|
|
|
label: '18:9',
|
2018-11-14 23:32:37 +01:00
|
|
|
cmd: [{
|
2018-11-18 03:29:16 +01:00
|
|
|
action: 'set-ar',
|
2019-03-10 23:27:50 +01:00
|
|
|
arg: AspectRatio.Fixed,
|
|
|
|
customArg: 2.0,
|
2018-11-14 23:32:37 +01:00
|
|
|
}],
|
2018-12-30 23:16:09 +01:00
|
|
|
scopes: {
|
|
|
|
page: {
|
|
|
|
show: true,
|
|
|
|
shortcut: [{
|
|
|
|
key: 'x',
|
2019-10-23 19:34:58 +02:00
|
|
|
code: 'KeyX',
|
2018-12-30 23:16:09 +01:00
|
|
|
ctrlKey: false,
|
|
|
|
metaKey: false,
|
|
|
|
altKey: false,
|
|
|
|
shiftKey: false,
|
|
|
|
onKeyUp: true,
|
|
|
|
onKeyDown: false,
|
|
|
|
}]
|
|
|
|
}
|
|
|
|
},
|
|
|
|
playerUi: {
|
|
|
|
show: true,
|
|
|
|
path: 'crop',
|
|
|
|
}
|
2019-10-24 23:27:43 +02:00
|
|
|
}, {
|
|
|
|
name: 'Don\'t persist crop',
|
|
|
|
label: 'Never persist',
|
|
|
|
cmd: [{
|
|
|
|
action: 'set-ar-persistence',
|
|
|
|
arg: CropModePersistence.Never,
|
|
|
|
}],
|
|
|
|
scopes: {
|
|
|
|
site: {
|
|
|
|
show: true,
|
|
|
|
},
|
|
|
|
global: {
|
|
|
|
show: true,
|
|
|
|
}
|
|
|
|
},
|
|
|
|
playerUi: {
|
|
|
|
show: true,
|
|
|
|
}
|
|
|
|
}, {
|
|
|
|
name: 'Persist crop while on page',
|
2019-11-02 01:05:36 +01:00
|
|
|
label: 'Until page load',
|
2019-10-24 23:27:43 +02:00
|
|
|
cmd: [{
|
|
|
|
action: 'set-ar-persistence',
|
|
|
|
arg: CropModePersistence.UntilPageReload,
|
|
|
|
}],
|
|
|
|
scopes: {
|
|
|
|
site: {
|
|
|
|
show: true,
|
|
|
|
},
|
|
|
|
global: {
|
|
|
|
show: true,
|
|
|
|
}
|
|
|
|
},
|
|
|
|
playerUi: {
|
|
|
|
show: true,
|
|
|
|
}
|
|
|
|
}, {
|
|
|
|
name: 'Persist crop for current session',
|
2019-10-28 22:10:15 +01:00
|
|
|
label: 'Current session',
|
2019-10-24 23:27:43 +02:00
|
|
|
cmd: [{
|
|
|
|
action: 'set-ar-persistence',
|
|
|
|
arg: CropModePersistence.CurrentSession,
|
|
|
|
}],
|
|
|
|
scopes: {
|
|
|
|
site: {
|
|
|
|
show: true,
|
|
|
|
},
|
|
|
|
global: {
|
|
|
|
show: true,
|
|
|
|
}
|
|
|
|
},
|
|
|
|
playerUi: {
|
|
|
|
show: true,
|
|
|
|
}
|
|
|
|
}, {
|
|
|
|
name: 'Persist until manually reset',
|
|
|
|
label: 'Always persist',
|
|
|
|
cmd: [{
|
|
|
|
action: 'set-ar-persistence',
|
|
|
|
arg: CropModePersistence.Forever,
|
|
|
|
}],
|
|
|
|
scopes: {
|
|
|
|
site: {
|
|
|
|
show: true,
|
|
|
|
},
|
|
|
|
global: {
|
|
|
|
show: true,
|
|
|
|
}
|
|
|
|
},
|
|
|
|
playerUi: {
|
|
|
|
show: true,
|
|
|
|
}
|
|
|
|
}, {
|
2019-11-02 01:05:36 +01:00
|
|
|
name: 'Default crop persistence',
|
2019-10-24 23:27:43 +02:00
|
|
|
label: 'Default',
|
|
|
|
cmd: [{
|
|
|
|
action: 'set-ar-persistence',
|
|
|
|
arg: CropModePersistence.Default,
|
|
|
|
}],
|
|
|
|
scopes: {
|
|
|
|
site: {
|
|
|
|
show: true,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
playerUi: {
|
|
|
|
show: true,
|
|
|
|
}
|
2019-10-23 19:34:58 +02:00
|
|
|
}, {
|
2018-12-30 23:16:09 +01:00
|
|
|
name: 'Zoom in',
|
|
|
|
label: 'Zoom',
|
2018-11-14 23:32:37 +01:00
|
|
|
cmd: [{
|
2019-01-03 02:07:16 +01:00
|
|
|
action: 'change-zoom',
|
2018-11-14 23:32:37 +01:00
|
|
|
arg: 0.1
|
|
|
|
}],
|
2018-12-30 23:16:09 +01:00
|
|
|
scopes: {
|
|
|
|
page: {
|
|
|
|
show: false,
|
|
|
|
shortcut: [{
|
|
|
|
key: 'z',
|
2019-10-23 19:34:58 +02:00
|
|
|
code: 'KeyY',
|
2018-12-30 23:16:09 +01:00
|
|
|
ctrlKey: false,
|
|
|
|
metaKey: false,
|
|
|
|
altKey: false,
|
|
|
|
shiftKey: false,
|
|
|
|
onKeyUp: true,
|
|
|
|
onKeyDown: false,
|
|
|
|
}],
|
|
|
|
}
|
|
|
|
},
|
|
|
|
playerUi: {
|
|
|
|
show: false,
|
|
|
|
}
|
2019-10-23 19:34:58 +02:00
|
|
|
}, {
|
2018-12-30 23:16:09 +01:00
|
|
|
name: 'Zoom out',
|
|
|
|
label: 'Unzoom',
|
2018-11-14 23:32:37 +01:00
|
|
|
cmd: [{
|
2019-01-03 02:07:16 +01:00
|
|
|
action: 'change-zoom',
|
2018-11-14 23:32:37 +01:00
|
|
|
arg: -0.1
|
|
|
|
}],
|
2018-12-30 23:16:09 +01:00
|
|
|
scopes: {
|
|
|
|
page: {
|
|
|
|
show: false,
|
|
|
|
shortcut: [{
|
|
|
|
key: 'u',
|
2019-10-23 19:34:58 +02:00
|
|
|
code: 'KeyU',
|
2018-12-30 23:16:09 +01:00
|
|
|
ctrlKey: false,
|
|
|
|
metaKey: false,
|
|
|
|
altKey: false,
|
|
|
|
shiftKey: false,
|
|
|
|
onKeyUp: true,
|
|
|
|
onKeyDown: false,
|
|
|
|
}],
|
|
|
|
}
|
|
|
|
},
|
|
|
|
playerUi: {
|
|
|
|
show: false
|
|
|
|
}
|
2019-10-23 19:34:58 +02:00
|
|
|
}, {
|
2018-12-30 23:16:09 +01:00
|
|
|
name: 'Toggle panning mode',
|
|
|
|
label: 'Toggle pan',
|
2018-11-14 23:32:37 +01:00
|
|
|
cmd: [{
|
|
|
|
action: 'toggle-pan',
|
|
|
|
arg: 'toggle'
|
|
|
|
}],
|
2018-12-30 23:16:09 +01:00
|
|
|
playerUi: {
|
|
|
|
show: true,
|
|
|
|
path: 'zoom'
|
2019-10-27 23:20:45 +01:00
|
|
|
},
|
|
|
|
scopes: {
|
2018-12-30 23:16:09 +01:00
|
|
|
}
|
2019-10-23 19:34:58 +02:00
|
|
|
}, {
|
2018-12-30 23:16:09 +01:00
|
|
|
name: 'Hold to pan',
|
2018-11-14 23:32:37 +01:00
|
|
|
cmd: [{
|
|
|
|
action: 'pan',
|
2018-11-18 18:44:44 +01:00
|
|
|
arg: 'toggle',
|
2018-11-14 23:32:37 +01:00
|
|
|
}],
|
2018-12-30 23:16:09 +01:00
|
|
|
scopes: {
|
|
|
|
page: {
|
|
|
|
show: false,
|
|
|
|
shortcut: [{
|
|
|
|
ctrlKey: false,
|
|
|
|
metaKey: false,
|
|
|
|
altKey: false,
|
|
|
|
shiftKey: true,
|
|
|
|
onKeyDown: false,
|
|
|
|
onKeyUp: false,
|
|
|
|
onMouseMove: true,
|
|
|
|
}],
|
|
|
|
}
|
|
|
|
}
|
2018-11-18 01:32:01 +01:00
|
|
|
},
|
|
|
|
//
|
|
|
|
// S T R E T C H I N G
|
|
|
|
//
|
|
|
|
{
|
2018-12-30 23:16:09 +01:00
|
|
|
name: 'Set stretch to "none"',
|
|
|
|
label: 'Don\'t stretch',
|
2018-11-18 01:32:01 +01:00
|
|
|
cmd: [{
|
2018-11-18 18:44:44 +01:00
|
|
|
action: 'set-stretch',
|
2019-01-20 22:59:06 +01:00
|
|
|
arg: Stretch.NoStretch,
|
2018-11-18 01:32:01 +01:00
|
|
|
}],
|
2018-12-30 23:16:09 +01:00
|
|
|
scopes: {
|
|
|
|
global: {
|
|
|
|
show: true,
|
|
|
|
label: 'Normal'
|
|
|
|
},
|
|
|
|
site: {
|
|
|
|
show: true,
|
|
|
|
label: 'Normal'
|
|
|
|
},
|
|
|
|
page: {
|
|
|
|
show: true,
|
|
|
|
label: 'Normal'
|
|
|
|
}
|
|
|
|
},
|
|
|
|
playerUi: {
|
|
|
|
show: true,
|
|
|
|
path: 'stretch'
|
|
|
|
}
|
2019-10-23 19:34:58 +02:00
|
|
|
}, {
|
2018-12-30 23:16:09 +01:00
|
|
|
name: 'Set stretch to "basic"',
|
|
|
|
label: 'Basic stretch',
|
2018-11-18 01:32:01 +01:00
|
|
|
cmd: [{
|
2018-11-18 18:44:44 +01:00
|
|
|
action: 'set-stretch',
|
2019-01-20 22:59:06 +01:00
|
|
|
arg: Stretch.Basic,
|
2018-11-18 01:32:01 +01:00
|
|
|
}],
|
2018-12-30 23:16:09 +01:00
|
|
|
scopes: {
|
|
|
|
global: {
|
|
|
|
show: true,
|
|
|
|
label: 'Basic'
|
|
|
|
},
|
|
|
|
site: {
|
|
|
|
show: true,
|
|
|
|
label: 'Basic'
|
|
|
|
},
|
|
|
|
page: {
|
|
|
|
show: true,
|
|
|
|
label: 'Basic'
|
|
|
|
}
|
|
|
|
},
|
|
|
|
playerUi: {
|
|
|
|
show: true,
|
|
|
|
path: 'stretch'
|
|
|
|
}
|
2019-10-23 19:34:58 +02:00
|
|
|
}, {
|
2018-12-30 23:16:09 +01:00
|
|
|
name: 'Set stretch to "hybrid"',
|
|
|
|
label: 'Hybrid stretch',
|
2018-11-18 01:32:01 +01:00
|
|
|
cmd: [{
|
2018-11-18 18:44:44 +01:00
|
|
|
action: 'set-stretch',
|
2019-01-20 22:59:06 +01:00
|
|
|
arg: Stretch.Hybrid,
|
2018-11-18 01:32:01 +01:00
|
|
|
}],
|
2018-12-30 23:16:09 +01:00
|
|
|
scopes: {
|
|
|
|
global: {
|
|
|
|
show: true,
|
|
|
|
label: 'Hybrid'
|
|
|
|
},
|
|
|
|
site: {
|
|
|
|
show: true,
|
|
|
|
label: 'Hybrid'
|
|
|
|
},
|
|
|
|
page: {
|
|
|
|
show: true,
|
|
|
|
label: 'Hybrid'
|
|
|
|
}
|
|
|
|
},
|
|
|
|
playerUi: {
|
|
|
|
show: true,
|
|
|
|
path: 'stretch'
|
|
|
|
}
|
2019-10-23 19:34:58 +02:00
|
|
|
}, {
|
2018-12-30 23:16:09 +01:00
|
|
|
name: 'Stretch only to hide thin borders',
|
|
|
|
label: 'Thin borders only',
|
2018-11-18 01:32:01 +01:00
|
|
|
cmd: [{
|
2018-11-18 18:44:44 +01:00
|
|
|
action: 'set-stretch',
|
2019-01-20 22:59:06 +01:00
|
|
|
arg: Stretch.Conditional,
|
2018-11-18 01:32:01 +01:00
|
|
|
}],
|
2018-12-30 23:16:09 +01:00
|
|
|
scopes: {
|
|
|
|
global: {
|
|
|
|
show: true,
|
|
|
|
label: 'Thin borders'
|
|
|
|
},
|
|
|
|
site: {
|
|
|
|
show: true,
|
|
|
|
label: 'Thin borders'
|
|
|
|
},
|
|
|
|
page: {
|
|
|
|
show: true,
|
|
|
|
label: 'Thin borders'
|
|
|
|
}
|
|
|
|
},
|
|
|
|
playerUi: {
|
|
|
|
show: true,
|
|
|
|
path: 'stretch'
|
|
|
|
}
|
2019-10-23 19:34:58 +02:00
|
|
|
}, {
|
2018-12-30 23:16:09 +01:00
|
|
|
name: 'Set stretch to default value',
|
|
|
|
label: 'Default',
|
2018-11-26 23:44:37 +01:00
|
|
|
cmd: [{
|
|
|
|
action: 'set-stretch',
|
2019-01-20 22:59:06 +01:00
|
|
|
arg: Stretch.Default,
|
2018-11-26 23:44:37 +01:00
|
|
|
}],
|
2018-12-30 23:16:09 +01:00
|
|
|
scopes: {
|
|
|
|
site: {
|
|
|
|
show: true,
|
|
|
|
}
|
|
|
|
}
|
2019-12-06 00:17:09 +01:00
|
|
|
}, // NEW OPTIONS
|
|
|
|
{
|
|
|
|
name: 'Stretch source to 4:3',
|
|
|
|
label: '4:3 stretch (src)',
|
|
|
|
cmd: [{
|
|
|
|
action: 'set-stretch',
|
|
|
|
arg: Stretch.FixedSource,
|
|
|
|
customArg: 1.33,
|
|
|
|
}],
|
|
|
|
scopes: {
|
|
|
|
page: {
|
|
|
|
show: true,
|
|
|
|
}
|
|
|
|
},
|
|
|
|
playerUi: {
|
|
|
|
show: true,
|
|
|
|
path: 'crop'
|
|
|
|
}
|
|
|
|
}, {
|
|
|
|
name: 'Stretch source to 16:9',
|
|
|
|
label: '16:9 stretch (src)',
|
|
|
|
cmd: [{
|
|
|
|
action: 'set-stretch',
|
|
|
|
arg: Stretch.FixedSource,
|
|
|
|
customArg: 1.77,
|
|
|
|
}],
|
|
|
|
scopes: {
|
|
|
|
page: {
|
|
|
|
show: true,
|
|
|
|
}
|
|
|
|
},
|
|
|
|
playerUi: {
|
|
|
|
show: true,
|
|
|
|
path: 'crop'
|
|
|
|
}
|
2018-11-18 01:32:01 +01:00
|
|
|
},
|
|
|
|
//
|
|
|
|
// A L I G N M E N T
|
|
|
|
//
|
|
|
|
{
|
2018-12-30 23:16:09 +01:00
|
|
|
name: 'Align video to the left',
|
|
|
|
label: 'Left',
|
2018-11-18 01:32:01 +01:00
|
|
|
cmd: [{
|
2018-11-18 18:44:44 +01:00
|
|
|
action: 'set-alignment',
|
2019-01-20 22:59:06 +01:00
|
|
|
arg: VideoAlignment.Left,
|
2018-11-18 01:32:01 +01:00
|
|
|
}],
|
2018-12-30 23:16:09 +01:00
|
|
|
scopes: {
|
|
|
|
global: {
|
|
|
|
show: true,
|
|
|
|
},
|
|
|
|
site: {
|
|
|
|
show: true,
|
|
|
|
},
|
|
|
|
page: {
|
|
|
|
show: true,
|
|
|
|
}
|
|
|
|
},
|
|
|
|
playerUi: {
|
|
|
|
show: true,
|
|
|
|
path: 'align'
|
|
|
|
}
|
2019-10-23 19:34:58 +02:00
|
|
|
}, {
|
2018-12-30 23:16:09 +01:00
|
|
|
name: 'Align video to center',
|
|
|
|
label: 'Center',
|
2018-11-18 01:32:01 +01:00
|
|
|
cmd: [{
|
2018-11-18 18:44:44 +01:00
|
|
|
action: 'set-alignment',
|
2019-01-20 22:59:06 +01:00
|
|
|
arg: VideoAlignment.Center,
|
2018-11-18 01:32:01 +01:00
|
|
|
}],
|
2018-12-30 23:16:09 +01:00
|
|
|
scopes: {
|
|
|
|
global: {
|
|
|
|
show: true,
|
|
|
|
},
|
|
|
|
site: {
|
|
|
|
show: true,
|
|
|
|
},
|
|
|
|
page: {
|
|
|
|
show: true,
|
|
|
|
}
|
|
|
|
},
|
|
|
|
playerUi: {
|
|
|
|
show: true,
|
|
|
|
path: 'align'
|
|
|
|
}
|
2019-10-23 19:34:58 +02:00
|
|
|
}, {
|
2018-12-30 23:16:09 +01:00
|
|
|
name: 'Align video to the right',
|
|
|
|
label: 'Right',
|
2018-11-18 01:32:01 +01:00
|
|
|
cmd: [{
|
2018-11-18 18:44:44 +01:00
|
|
|
action: 'set-alignment',
|
2019-01-20 22:59:06 +01:00
|
|
|
arg: VideoAlignment.Right
|
2018-11-18 01:32:01 +01:00
|
|
|
}],
|
2018-12-30 23:16:09 +01:00
|
|
|
scopes: {
|
|
|
|
global: {
|
|
|
|
show: true,
|
|
|
|
},
|
|
|
|
site: {
|
|
|
|
show: true,
|
|
|
|
},
|
|
|
|
page: {
|
|
|
|
show: true,
|
|
|
|
}
|
|
|
|
},
|
|
|
|
playerUi: {
|
|
|
|
show: true,
|
|
|
|
path: 'align'
|
|
|
|
}
|
2019-10-23 19:34:58 +02:00
|
|
|
}, {
|
2018-12-30 23:16:09 +01:00
|
|
|
name: 'Use default alignment',
|
|
|
|
label: 'Default',
|
2018-11-26 23:44:37 +01:00
|
|
|
cmd: [{
|
|
|
|
action: 'set-alignment',
|
2019-01-20 22:59:06 +01:00
|
|
|
arg: VideoAlignment.Default
|
2018-11-26 23:44:37 +01:00
|
|
|
}],
|
2018-12-30 23:16:09 +01:00
|
|
|
scopes: {
|
|
|
|
site: {
|
|
|
|
show: true,
|
|
|
|
}
|
|
|
|
}
|
2018-11-26 23:44:37 +01:00
|
|
|
},
|
|
|
|
//
|
|
|
|
// E N A B L E E X T E N S I O N / A U T O A R
|
|
|
|
// (for sites/extension tab in the popup)
|
|
|
|
//
|
2018-12-30 23:16:09 +01:00
|
|
|
{
|
|
|
|
name: 'Enable extension',
|
|
|
|
label: 'Enable',
|
2018-11-26 23:44:37 +01:00
|
|
|
cmd: [{
|
|
|
|
action: 'set-extension-mode',
|
2019-01-20 22:59:06 +01:00
|
|
|
arg: ExtensionMode.Enabled,
|
2018-11-26 23:44:37 +01:00
|
|
|
persistent: true,
|
|
|
|
}],
|
2018-12-30 23:16:09 +01:00
|
|
|
scopes: {
|
|
|
|
global: {
|
|
|
|
show: true,
|
|
|
|
},
|
|
|
|
site: {
|
|
|
|
show: true,
|
|
|
|
}
|
|
|
|
}
|
2019-10-23 19:34:58 +02:00
|
|
|
}, {
|
2018-12-30 23:16:09 +01:00
|
|
|
name: 'Enable extension on whitelisted sites only',
|
|
|
|
label: 'On whitelist only',
|
2018-11-26 23:44:37 +01:00
|
|
|
cmd: [{
|
|
|
|
action: 'set-extension-mode',
|
2019-01-20 22:59:06 +01:00
|
|
|
arg: ExtensionMode.Whitelist,
|
2018-11-26 23:44:37 +01:00
|
|
|
persistent: true,
|
|
|
|
}],
|
2018-12-30 23:16:09 +01:00
|
|
|
scopes: {
|
|
|
|
global: {
|
|
|
|
show: true
|
|
|
|
}
|
|
|
|
}
|
2019-10-23 19:34:58 +02:00
|
|
|
}, {
|
2018-12-30 23:16:09 +01:00
|
|
|
name: 'Extension mode: use default settings',
|
|
|
|
label: 'Default',
|
2018-11-26 23:44:37 +01:00
|
|
|
cmd: [{
|
|
|
|
action: 'set-extension-mode',
|
2019-01-20 22:59:06 +01:00
|
|
|
arg: ExtensionMode.Default,
|
2018-11-26 23:44:37 +01:00
|
|
|
persistent: true,
|
|
|
|
}],
|
2018-12-30 23:16:09 +01:00
|
|
|
scopes: {
|
|
|
|
site: {
|
|
|
|
show: true
|
|
|
|
}
|
|
|
|
}
|
2019-10-23 19:34:58 +02:00
|
|
|
}, {
|
2018-12-30 23:16:09 +01:00
|
|
|
name: 'Disable extension',
|
|
|
|
label: 'Disable',
|
2018-11-26 23:44:37 +01:00
|
|
|
cmd: [{
|
|
|
|
action: 'set-extension-mode',
|
2019-01-20 22:59:06 +01:00
|
|
|
arg: ExtensionMode.Disabled,
|
2018-11-26 23:44:37 +01:00
|
|
|
persistent: true,
|
|
|
|
}],
|
2018-12-30 23:16:09 +01:00
|
|
|
scopes: {
|
|
|
|
global: {
|
|
|
|
show: true,
|
|
|
|
},
|
|
|
|
site: {
|
|
|
|
show: true,
|
|
|
|
}
|
|
|
|
}
|
2019-10-23 19:34:58 +02:00
|
|
|
}, {
|
2018-12-30 23:16:09 +01:00
|
|
|
name: 'Enable automatic aspect ratio detection',
|
2019-02-13 16:15:56 +01:00
|
|
|
label: 'Enable',
|
2018-11-26 23:44:37 +01:00
|
|
|
cmd: [{
|
|
|
|
action: 'set-autoar-mode',
|
2019-01-20 22:59:06 +01:00
|
|
|
arg: ExtensionMode.Enabled,
|
2018-11-26 23:44:37 +01:00
|
|
|
persistent: true,
|
|
|
|
}],
|
2018-12-30 23:16:09 +01:00
|
|
|
scopes: {
|
|
|
|
global: {
|
|
|
|
show: true
|
|
|
|
},
|
|
|
|
site: {
|
|
|
|
show: true
|
|
|
|
}
|
|
|
|
}
|
2019-10-23 19:34:58 +02:00
|
|
|
}, {
|
2018-12-30 23:16:09 +01:00
|
|
|
name: 'Enable automatic aspect ratio detection on whitelisted sites only',
|
|
|
|
label: 'On whitelist only',
|
2018-11-26 23:44:37 +01:00
|
|
|
cmd: [{
|
|
|
|
action: 'set-autoar-mode',
|
2019-01-20 22:59:06 +01:00
|
|
|
arg: ExtensionMode.Whitelist,
|
2018-11-26 23:44:37 +01:00
|
|
|
persistent: true,
|
|
|
|
}],
|
2018-12-30 23:16:09 +01:00
|
|
|
scopes: {
|
|
|
|
global: {
|
|
|
|
show: true,
|
|
|
|
}
|
|
|
|
}
|
2019-10-23 19:34:58 +02:00
|
|
|
}, {
|
2018-12-30 23:16:09 +01:00
|
|
|
name: 'Use default settings for automatic aspect ratio detection',
|
|
|
|
label: 'Default',
|
2018-11-26 23:44:37 +01:00
|
|
|
cmd: [{
|
|
|
|
action: 'set-autoar-mode',
|
2019-01-20 22:59:06 +01:00
|
|
|
arg: ExtensionMode.Default,
|
2018-11-26 23:44:37 +01:00
|
|
|
persistent: true,
|
|
|
|
}],
|
2018-12-30 23:16:09 +01:00
|
|
|
scopes: {
|
|
|
|
site: {
|
|
|
|
show: true,
|
|
|
|
}
|
|
|
|
}
|
2019-10-23 19:34:58 +02:00
|
|
|
}, {
|
2018-12-30 23:16:09 +01:00
|
|
|
name: 'Disable automatic aspect ratio detection',
|
|
|
|
label: 'Disable',
|
2018-11-26 23:44:37 +01:00
|
|
|
cmd: [{
|
|
|
|
action: 'set-autoar-mode',
|
2019-01-20 22:59:06 +01:00
|
|
|
arg: ExtensionMode.Disabled,
|
2018-11-26 23:44:37 +01:00
|
|
|
persistent: true,
|
|
|
|
}],
|
2018-12-30 23:16:09 +01:00
|
|
|
scopes: {
|
|
|
|
global: {
|
|
|
|
show: true,
|
|
|
|
},
|
|
|
|
site: {
|
|
|
|
show: true,
|
|
|
|
}
|
|
|
|
}
|
2019-06-02 23:49:48 +02:00
|
|
|
},
|
|
|
|
//
|
|
|
|
//
|
|
|
|
// Enable/disable keyboard shortcuts
|
|
|
|
//
|
|
|
|
{
|
|
|
|
name: 'Enable keyboard shortcuts',
|
|
|
|
label: 'Enable',
|
|
|
|
cmd: [{
|
|
|
|
action: 'set-keyboard',
|
|
|
|
arg: ExtensionMode.Enabled,
|
|
|
|
}],
|
|
|
|
scopes: {
|
|
|
|
global: {
|
|
|
|
show: true,
|
|
|
|
},
|
|
|
|
site: {
|
|
|
|
show: true,
|
|
|
|
},
|
|
|
|
page: {
|
|
|
|
show: true,
|
|
|
|
}
|
|
|
|
}
|
2019-10-23 19:34:58 +02:00
|
|
|
}, {
|
2019-06-02 23:49:48 +02:00
|
|
|
name: 'Enable keyboard shortcuts on whitelisted sites only',
|
|
|
|
label: 'On whitelist only',
|
|
|
|
cmd: [{
|
|
|
|
action: 'set-keyboard',
|
|
|
|
arg: ExtensionMode.Whitelist,
|
|
|
|
}],
|
|
|
|
scopes: {
|
|
|
|
global: {
|
|
|
|
show: true
|
|
|
|
},
|
|
|
|
}
|
2019-10-23 19:34:58 +02:00
|
|
|
}, {
|
2019-06-02 23:49:48 +02:00
|
|
|
name: 'Keyboard shortcuts mode: use default settings',
|
|
|
|
label: 'Default',
|
|
|
|
cmd: [{
|
|
|
|
action: 'set-keyboard',
|
|
|
|
arg: ExtensionMode.Default,
|
|
|
|
}],
|
|
|
|
scopes: {
|
|
|
|
site: {
|
|
|
|
show: true
|
|
|
|
}
|
|
|
|
}
|
2019-10-23 19:34:58 +02:00
|
|
|
}, {
|
2019-06-02 23:49:48 +02:00
|
|
|
name: 'Disable keyboard shortcuts',
|
|
|
|
label: 'Disable',
|
|
|
|
cmd: [{
|
|
|
|
action: 'set-keyboard',
|
|
|
|
arg: ExtensionMode.Disabled,
|
|
|
|
}],
|
|
|
|
scopes: {
|
|
|
|
global: {
|
|
|
|
show: true,
|
|
|
|
},
|
|
|
|
site: {
|
|
|
|
show: true,
|
|
|
|
},
|
|
|
|
page: {
|
|
|
|
show: true,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
2019-12-06 00:17:09 +01:00
|
|
|
],
|
|
|
|
whatsNewChecked: true,
|
2018-11-14 23:32:37 +01:00
|
|
|
// -----------------------------------------
|
2018-06-27 23:55:37 +02:00
|
|
|
// ::: SITE CONFIGURATION :::
|
|
|
|
// -----------------------------------------
|
|
|
|
// Nastavitve za posamezno stran
|
|
|
|
// Config for a given page:
|
|
|
|
//
|
|
|
|
// <hostname> : {
|
|
|
|
// status: <option> // should extension work on this site?
|
|
|
|
// arStatus: <option> // should we do autodetection on this site?
|
2018-09-16 14:14:16 +02:00
|
|
|
//
|
2019-01-20 23:36:08 +01:00
|
|
|
// defaultAr?: <ratio> // automatically apply this aspect ratio on this side. Use extension defaults if undefined.
|
2018-09-16 14:14:16 +02:00
|
|
|
// stretch? <stretch mode> // automatically stretch video on this site in this manner
|
|
|
|
// videoAlignment? <left|center|right>
|
|
|
|
//
|
|
|
|
// type: <official|community|user> // 'official' — blessed by Tam.
|
|
|
|
// // 'community' — blessed by reddit.
|
|
|
|
// // 'user' — user-defined (not here)
|
|
|
|
// override: <true|false> // override user settings for this site on update
|
2018-06-27 23:55:37 +02:00
|
|
|
// }
|
|
|
|
//
|
|
|
|
// Veljavne vrednosti za možnosti
|
|
|
|
// Valid values for options:
|
|
|
|
//
|
|
|
|
// status, arStatus, statusEmbedded:
|
|
|
|
//
|
2018-11-02 02:52:01 +01:00
|
|
|
// * enabled — always allow, full
|
|
|
|
// * basic — allow, but only the basic version without playerData
|
2018-06-27 23:55:37 +02:00
|
|
|
// * default — allow if default is to allow, block if default is to block
|
|
|
|
// * disabled — never allow
|
|
|
|
//
|
|
|
|
sites: {
|
2019-01-20 22:59:06 +01:00
|
|
|
"@global": { // global defaults. Possible options will state site-only options in order
|
|
|
|
// to avoid writing this multiple times. Tags:
|
|
|
|
// #g — only available in @global
|
|
|
|
// #s — only available for specific site
|
|
|
|
mode: ExtensionMode.Enabled, // How should extension work:
|
|
|
|
// 'enabled' - work everywhere except blacklist
|
|
|
|
// 'whitelist' - only work on whitelisted sites (#g)
|
|
|
|
// 'disabled' - work nowhere
|
|
|
|
// 'basic' - (Possible future use)
|
|
|
|
// 'default' - follow global rules (#s)
|
|
|
|
autoar: ExtensionMode.Enabled, // Should we try to automatically detect aspect ratio?
|
|
|
|
// Options: 'enabled', 'whitelist' (#g), 'default' (#s), 'disabled'
|
|
|
|
autoarFallback: currentBrowser.firefox ? // if autoAr fails, try fallback mode?
|
|
|
|
ExtensionMode.Enabled : // Options same as in autoar.
|
|
|
|
ExtensionMode.Disabled, // if autoar is disabled, this setting is irrelevant
|
|
|
|
stretch: Stretch.NoStretch, // Default stretch mode.
|
|
|
|
videoAlignment: VideoAlignment.Center, // Video alignment
|
2019-06-02 23:49:48 +02:00
|
|
|
keyboardShortcutsEnabled: ExtensionMode.Enabled,
|
2019-01-20 22:59:06 +01:00
|
|
|
},
|
2018-06-27 23:55:37 +02:00
|
|
|
"www.youtube.com" : {
|
2019-01-20 22:59:06 +01:00
|
|
|
mode: ExtensionMode.Enabled,
|
|
|
|
autoar: ExtensionMode.Enabled,
|
|
|
|
autoarFallback: ExtensionMode.Enabled,
|
2018-08-30 00:56:15 +02:00
|
|
|
override: false, // ignore value localStorage in favour of this
|
2018-11-14 23:32:37 +01:00
|
|
|
type: 'official', // is officially supported? (Alternatives are 'community' and 'user-defined')
|
|
|
|
actions: null, // overrides global keyboard shortcuts and button configs. Is array, is optional.
|
2019-01-26 17:52:50 +01:00
|
|
|
stretch: Stretch.Default,
|
|
|
|
videoAlignment: VideoAlignment.Default,
|
2019-06-02 23:49:48 +02:00
|
|
|
keyboardShortcutsEnabled: ExtensionMode.Default,
|
2019-07-03 20:17:55 +02:00
|
|
|
DOM: {
|
|
|
|
player: {
|
|
|
|
manual: true,
|
2019-07-05 23:00:15 +02:00
|
|
|
querySelectors: "#movie_player, #player",
|
2019-07-03 20:17:55 +02:00
|
|
|
additionalCss: "",
|
|
|
|
useRelativeAncestor: false,
|
|
|
|
playerNodeCss: "",
|
|
|
|
}
|
|
|
|
}
|
2018-06-27 23:55:37 +02:00
|
|
|
},
|
|
|
|
"www.netflix.com" : {
|
2019-01-20 22:59:06 +01:00
|
|
|
mode: ExtensionMode.Enabled,
|
|
|
|
autoar: currentBrowser.firefox ? ExtensionMode.Enabled : ExtensionMode.Disabled,
|
2018-08-30 00:56:15 +02:00
|
|
|
override: false,
|
2019-01-26 17:52:50 +01:00
|
|
|
type: 'official',
|
|
|
|
stretch: Stretch.Default,
|
|
|
|
videoAlignment: VideoAlignment.Default,
|
2019-06-02 23:49:48 +02:00
|
|
|
keyboardShortcutsEnabled: ExtensionMode.Default,
|
2019-07-18 21:25:58 +02:00
|
|
|
arPersistence: true, // persist aspect ratio between different videos
|
2019-05-26 02:53:29 +02:00
|
|
|
autoarPreventConditions: { // prevents autoar on following conditions
|
|
|
|
videoStyleString: { // if video style string thing does anything of what follows
|
|
|
|
containsProperty: { // if video style string has any of these properties (listed as keys)
|
|
|
|
'height': { // if 'height' property is present in style attribute, we prevent autoar from running
|
|
|
|
allowedValues: [ // unless attribute is equal to anything in here. Optional.
|
|
|
|
'100%'
|
|
|
|
]
|
|
|
|
}
|
|
|
|
// 'width': true // this would prevent aard from runing if <video> had a 'width' property in style, regardless of value
|
|
|
|
// could also be an empty object, in theory.
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2018-06-27 23:55:37 +02:00
|
|
|
},
|
2019-07-03 20:17:55 +02:00
|
|
|
"www.twitch.tv": {
|
|
|
|
mode: ExtensionMode.Enabled,
|
2019-09-01 03:23:19 +02:00
|
|
|
autoar: ExtensionMode.Enabled,
|
2019-07-03 20:17:55 +02:00
|
|
|
override: true,
|
|
|
|
type: 'official',
|
|
|
|
stretch: Stretch.Default,
|
|
|
|
videoAlignment: VideoAlignment.Default,
|
|
|
|
keyboardShortcutsEnabled: ExtensionMode.Default,
|
|
|
|
DOM: {
|
|
|
|
player: {
|
2019-10-20 14:09:19 +02:00
|
|
|
manual: false,
|
|
|
|
querySelectors: "",
|
2019-07-03 20:17:55 +02:00
|
|
|
additionalCss: "",
|
|
|
|
useRelativeAncestor: false,
|
|
|
|
playerNodeCss: ""
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
2019-07-03 21:37:03 +02:00
|
|
|
"vimeo.com": {
|
|
|
|
mode: 3,
|
|
|
|
autoar: 3,
|
|
|
|
type: 'official',
|
|
|
|
stretch: -1,
|
|
|
|
videoAlignment: -1,
|
|
|
|
keyboardShortcutsEnabled: 0,
|
|
|
|
DOM: {
|
|
|
|
player: {
|
|
|
|
manual: true,
|
|
|
|
querySelectors: ".player_outro_area",
|
|
|
|
useRelativeAncestor: false,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
css: ".player_outro_area {\n width: 100% !important;\n display: flex !important;\n justify-content: center !important;\n}\n\n.player_container, .player {\n width: 100% !important; \n}"
|
|
|
|
},
|
2019-06-07 01:50:13 +02:00
|
|
|
"old.reddit.com" : {
|
|
|
|
mode: ExtensionMode.Enabled,
|
2019-09-01 03:23:19 +02:00
|
|
|
autoar:ExtensionMode.Enabled,
|
2019-06-07 01:50:13 +02:00
|
|
|
override: false,
|
2019-07-03 21:37:03 +02:00
|
|
|
type: 'testing',
|
2019-06-07 01:50:13 +02:00
|
|
|
stretch: Stretch.Default,
|
|
|
|
videoAlignment: VideoAlignment.Default,
|
|
|
|
keyboardShortcutsEnabled: ExtensionMode.Default,
|
2019-06-10 23:45:15 +02:00
|
|
|
DOM: {
|
|
|
|
player: {
|
2019-09-22 02:07:04 +02:00
|
|
|
manual: false,
|
2019-07-03 21:37:03 +02:00
|
|
|
useRelativeAncestor: false,
|
2019-09-01 01:17:49 +02:00
|
|
|
querySelectors: '.reddit-video-player-root, .media-preview-content'
|
2019-06-24 14:05:37 +02:00
|
|
|
}
|
|
|
|
},
|
2019-09-22 02:07:04 +02:00
|
|
|
css: 'video {\n width: 100% !important;\n height: 100% !important;\n}',
|
2019-06-24 14:05:37 +02:00
|
|
|
},
|
|
|
|
"www.reddit.com" : {
|
|
|
|
mode: ExtensionMode.Enabled,
|
2019-09-01 03:23:19 +02:00
|
|
|
autoar: ExtensionMode.Enabled,
|
2019-06-24 14:05:37 +02:00
|
|
|
override: false,
|
2019-07-03 21:37:03 +02:00
|
|
|
type: 'testing',
|
2019-06-24 14:05:37 +02:00
|
|
|
stretch: Stretch.Default,
|
|
|
|
videoAlignment: VideoAlignment.Default,
|
|
|
|
keyboardShortcutsEnabled: ExtensionMode.Default,
|
|
|
|
DOM: {
|
|
|
|
player: {
|
2019-09-22 02:07:04 +02:00
|
|
|
manual: false,
|
2019-07-03 21:37:03 +02:00
|
|
|
useRelativeAncestor: false,
|
2019-09-01 01:17:49 +02:00
|
|
|
querySelectors: '.reddit-video-player-root, .media-preview-content'
|
2019-06-10 23:45:15 +02:00
|
|
|
}
|
2019-06-14 02:15:24 +02:00
|
|
|
},
|
2019-09-22 02:07:04 +02:00
|
|
|
css: 'video {\n width: 100% !important;\n height: 100% !important;\n}',
|
2019-06-14 23:20:47 +02:00
|
|
|
},
|
2019-11-29 01:33:58 +01:00
|
|
|
"www.disneyplus.com": {
|
|
|
|
DOM: {
|
|
|
|
player: {
|
|
|
|
periodicallyRefreshPlayerElement: true,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
2019-06-14 23:20:47 +02:00
|
|
|
"imgur.com": {
|
|
|
|
mode: -1,
|
|
|
|
autoar: -1,
|
|
|
|
autoarFallback: 0,
|
|
|
|
stretch: -1,
|
2019-07-03 21:37:03 +02:00
|
|
|
videoAlignment: 1,
|
|
|
|
type: 'official',
|
2019-06-07 01:50:13 +02:00
|
|
|
},
|
2019-06-15 23:03:19 +02:00
|
|
|
"gfycat.com": {
|
|
|
|
mode: -1,
|
|
|
|
autoar: -1,
|
|
|
|
autoarFallback: 0,
|
|
|
|
stretch: -1,
|
2019-07-03 21:37:03 +02:00
|
|
|
videoAlignment: 1,
|
|
|
|
type: 'official,'
|
2019-06-15 23:03:19 +02:00
|
|
|
},
|
|
|
|
"giant.gfycat.com": {
|
|
|
|
mode: -1,
|
|
|
|
autoar: -1,
|
|
|
|
autoarFallback: 0,
|
|
|
|
stretch: -1,
|
2019-07-03 21:37:03 +02:00
|
|
|
videoAlignment: 1,
|
|
|
|
type: 'official',
|
2019-06-15 23:03:19 +02:00
|
|
|
},
|
2017-12-31 18:26:59 +01:00
|
|
|
}
|
2017-12-17 22:56:07 +01:00
|
|
|
}
|
2018-12-30 23:16:09 +01:00
|
|
|
|
|
|
|
export default ExtensionConf;
|