Compare commits
No commits in common. "b4e932581c9e90aae3005078bc00332fcd94caee" and "d780a8cb12e2fc1348907a5479cad6d927756734" have entirely different histories.
b4e932581c
...
d780a8cb12
@ -2,6 +2,5 @@ import StretchType from '../enums/StretchType.enum';
|
|||||||
|
|
||||||
export interface Stretch {
|
export interface Stretch {
|
||||||
type: StretchType,
|
type: StretchType,
|
||||||
ratio?: number,
|
ratio?: number
|
||||||
limit?: number,
|
|
||||||
}
|
}
|
||||||
|
@ -401,15 +401,8 @@ export default {
|
|||||||
commandArguments = undefined;
|
commandArguments = undefined;
|
||||||
}
|
}
|
||||||
|
|
||||||
await this.siteSettings.set(option, commandArguments, {reload: false});
|
await this.siteSettings.set(option, commandArguments);
|
||||||
|
this.$nextTick( () => this.$forceUpdate() );
|
||||||
// changing alignment options doesn't trigger re-compute, so we need to do it ourselves.
|
|
||||||
// note that this re-computes siteDefaultAlignment even when setting other options, but
|
|
||||||
// it's _too late AM_ and hit to performance probably isn't bad enough to warrant
|
|
||||||
// spending time on a more correct solution tomorrow
|
|
||||||
this._computedWatchers.siteDefaultAlignment.run();
|
|
||||||
|
|
||||||
this.$nextTick( () => this.$forceUpdate());
|
|
||||||
},
|
},
|
||||||
setExtensionMode(component, event) {
|
setExtensionMode(component, event) {
|
||||||
const option = event.target.value;
|
const option = event.target.value;
|
||||||
|
@ -27,11 +27,11 @@
|
|||||||
(unaware, not using the site, language barrier, geoblocking, paid services Tam doesn't use).
|
(unaware, not using the site, language barrier, geoblocking, paid services Tam doesn't use).
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div v-if="siteSupportLevel === 'user-added' || siteSupportLevel === 'user-defined'" class="site-support user-added">
|
<div v-if="siteSupportLevel === 'user-added'" class="site-support user-added">
|
||||||
<mdicon name="account" />
|
<mdicon name="account" />
|
||||||
<div v-if="!small">Modified by you</div>
|
<div v-if="!small">Custom</div>
|
||||||
<div class="tooltip">
|
<div class="tooltip">
|
||||||
<template v-if="small">Modified by you — </template>
|
<template v-if="small">Custom — </template>
|
||||||
You have manually changed settings for this site. The extension is doing what you told it to do.
|
You have manually changed settings for this site. The extension is doing what you told it to do.
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -24,7 +24,10 @@ class Stretcher {
|
|||||||
siteSettings: SiteSettings;
|
siteSettings: SiteSettings;
|
||||||
//#endregion
|
//#endregion
|
||||||
|
|
||||||
|
//#region misc data
|
||||||
stretch: Stretch;
|
stretch: Stretch;
|
||||||
|
fixedStretchRatio: any;
|
||||||
|
//#endregion
|
||||||
|
|
||||||
// functions
|
// functions
|
||||||
constructor(videoData) {
|
constructor(videoData) {
|
||||||
@ -62,11 +65,11 @@ class Stretcher {
|
|||||||
actualWidth = newWidth;
|
actualWidth = newWidth;
|
||||||
}
|
}
|
||||||
|
|
||||||
let minW = this.conf.player.dimensions.width * (1 - this.stretch.limit);
|
let minW = this.conf.player.dimensions.width * (1 - this.settings.active.stretch.conditionalDifferencePercent);
|
||||||
let maxW = this.conf.player.dimensions.width * (1 + this.stretch.limit);
|
let maxW = this.conf.player.dimensions.width * (1 + this.settings.active.stretch.conditionalDifferencePercent);
|
||||||
|
|
||||||
let minH = this.conf.player.dimensions.height * (1 - this.stretch.limit);
|
let minH = this.conf.player.dimensions.height * (1 - this.settings.active.stretch.conditionalDifferencePercent);
|
||||||
let maxH = this.conf.player.dimensions.height * (1 + this.stretch.limit);
|
let maxH = this.conf.player.dimensions.height * (1 + this.settings.active.stretch.conditionalDifferencePercent);
|
||||||
|
|
||||||
if (actualWidth >= minW && actualWidth <= maxW) {
|
if (actualWidth >= minW && actualWidth <= maxW) {
|
||||||
stretchFactors.xFactor *= this.conf.player.dimensions.width / actualWidth;
|
stretchFactors.xFactor *= this.conf.player.dimensions.width / actualWidth;
|
||||||
@ -77,6 +80,16 @@ class Stretcher {
|
|||||||
}
|
}
|
||||||
|
|
||||||
calculateBasicStretch() {
|
calculateBasicStretch() {
|
||||||
|
// video.videoWidth in video.videoHeight predstavljata velikost datoteke.
|
||||||
|
// velikost video datoteke je lahko drugačna kot velikost <video> elementa.
|
||||||
|
// Zaradi tega lahko pride do te situacije:
|
||||||
|
// * Ločljivost videa je 850x480 (videoWidth & videoHeight)
|
||||||
|
// * Velikost <video> značke je 1920x720.
|
||||||
|
// Znotraj te video značke bo video prikazan v 1280x720 pravokotniku. Raztegovanje
|
||||||
|
// torej hočemo računati z uporabo vrednosti 1280 in 720. Teh vrednosti pa ne
|
||||||
|
// poznamo. Torej jih moramo računati.
|
||||||
|
//
|
||||||
|
//
|
||||||
// video.videoWidth and video.videoHeight describe the size of the video file.
|
// video.videoWidth and video.videoHeight describe the size of the video file.
|
||||||
// Size of the video file can be different than the size of the <video> tag.
|
// Size of the video file can be different than the size of the <video> tag.
|
||||||
// This can leave us with the following situation:
|
// This can leave us with the following situation:
|
||||||
@ -104,7 +117,7 @@ class Stretcher {
|
|||||||
const streamAr = this.conf.aspectRatio;
|
const streamAr = this.conf.aspectRatio;
|
||||||
const playerAr = this.conf.player.aspectRatio;
|
const playerAr = this.conf.player.aspectRatio;
|
||||||
|
|
||||||
const squeezeFactor = this.stretch.ratio / streamAr;
|
const squeezeFactor = this.fixedStretchRatio / streamAr;
|
||||||
|
|
||||||
// Whether squeezing happens on X or Y axis depends on whether required AR is wider or narrower than
|
// Whether squeezing happens on X or Y axis depends on whether required AR is wider or narrower than
|
||||||
// the player, in which the video is displayed
|
// the player, in which the video is displayed
|
||||||
@ -113,7 +126,7 @@ class Stretcher {
|
|||||||
|
|
||||||
this.logger.log('info', 'stretcher', `[Stretcher::applyStretchFixedSource] here's what we got:
|
this.logger.log('info', 'stretcher', `[Stretcher::applyStretchFixedSource] here's what we got:
|
||||||
postCropStretchFactors: x=${postCropStretchFactors.xFactor} y=${postCropStretchFactors.yFactor}
|
postCropStretchFactors: x=${postCropStretchFactors.xFactor} y=${postCropStretchFactors.yFactor}
|
||||||
fixedStretchRatio: ${this.stretch.ratio}
|
fixedStretchRatio: ${this.fixedStretchRatio}
|
||||||
videoAr: ${streamAr}
|
videoAr: ${streamAr}
|
||||||
playerAr: ${playerAr}
|
playerAr: ${playerAr}
|
||||||
squeezeFactor: ${squeezeFactor}`, '\nvideo', this.conf.video);
|
squeezeFactor: ${squeezeFactor}`, '\nvideo', this.conf.video);
|
||||||
@ -126,7 +139,7 @@ squeezeFactor: ${squeezeFactor}`, '\nvideo', this.conf.video);
|
|||||||
}
|
}
|
||||||
|
|
||||||
calculateStretchFixed(actualAr) {
|
calculateStretchFixed(actualAr) {
|
||||||
return this.calculateStretch(actualAr, this.stretch.ratio);
|
return this.calculateStretch(actualAr, this.fixedStretchRatio);
|
||||||
}
|
}
|
||||||
|
|
||||||
getArCorrectionFactor() {
|
getArCorrectionFactor() {
|
||||||
|
Loading…
Reference in New Issue
Block a user