Minor fixes
This commit is contained in:
parent
59df28029f
commit
66bcc40fb4
@ -62,7 +62,7 @@ class CommsClient {
|
|||||||
if (message.cmd === "set-ar") {
|
if (message.cmd === "set-ar") {
|
||||||
this.pageInfo.setAr({type: message.arg, ratio: message.customArg}, message.playing);
|
this.pageInfo.setAr({type: message.arg, ratio: message.customArg}, message.playing);
|
||||||
} else if (message.cmd === 'set-alignment') {
|
} else if (message.cmd === 'set-alignment') {
|
||||||
this.pageInfo.setvideoAlignment(message.arg, message.playing);
|
this.pageInfo.setVideoAlignment(message.arg, message.playing);
|
||||||
this.pageInfo.restoreAr();
|
this.pageInfo.restoreAr();
|
||||||
} else if (message.cmd === "set-stretch") {
|
} else if (message.cmd === "set-stretch") {
|
||||||
this.pageInfo.setStretchMode(message.arg, message.playing);
|
this.pageInfo.setStretchMode(message.arg, message.playing);
|
||||||
|
@ -195,9 +195,13 @@ class PageInfo {
|
|||||||
} else {
|
} else {
|
||||||
this.logger.log('info', 'videoRescan', "[PageInfo::rescan] found new video candidate:", video, "NOTE:: Video initialization starts here:\n--------------------------------\n")
|
this.logger.log('info', 'videoRescan', "[PageInfo::rescan] found new video candidate:", video, "NOTE:: Video initialization starts here:\n--------------------------------\n")
|
||||||
|
|
||||||
|
try {
|
||||||
v = new VideoData(video, this.settings, this);
|
v = new VideoData(video, this.settings, this);
|
||||||
v.initArDetection();
|
v.initArDetection();
|
||||||
this.videos.push(v);
|
this.videos.push(v);
|
||||||
|
} catch (e) {
|
||||||
|
this.logger.log('error', 'debug', "rescan error: failed to initialize videoData. Skipping this video.",e);
|
||||||
|
}
|
||||||
|
|
||||||
this.logger.log('info', 'videoRescan', "END VIDEO INITIALIZATION\n\n\n-------------------------------------\nvideos[] is now this:", this.videos,"\n\n\n\n\n\n\n\n")
|
this.logger.log('info', 'videoRescan', "END VIDEO INITIALIZATION\n\n\n-------------------------------------\nvideos[] is now this:", this.videos,"\n\n\n\n\n\n\n\n")
|
||||||
}
|
}
|
||||||
@ -275,8 +279,8 @@ class PageInfo {
|
|||||||
|
|
||||||
var ths = this;
|
var ths = this;
|
||||||
|
|
||||||
this.rescanTimer = setTimeout(function(){
|
this.urlCheckTimer = setTimeout(function(){
|
||||||
ths.rescanTimer = null;
|
ths.urlCheckTimer = null;
|
||||||
ths.ghettoUrlCheck();
|
ths.ghettoUrlCheck();
|
||||||
ths = null;
|
ths = null;
|
||||||
}, this.settings.active.pageInfo.timeouts.urlCheck)
|
}, this.settings.active.pageInfo.timeouts.urlCheck)
|
||||||
@ -418,16 +422,16 @@ class PageInfo {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
setvideoAlignment(videoAlignment, playingOnly) {
|
setVideoAlignment(videoAlignment, playingOnly) {
|
||||||
if (playingOnly) {
|
if (playingOnly) {
|
||||||
for(var vd of this.videos) {
|
for(var vd of this.videos) {
|
||||||
if (vd.isPlaying()) {
|
if (vd.isPlaying()) {
|
||||||
vd.setvideoAlignment(videoAlignment)
|
vd.setVideoAlignment(videoAlignment)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
for(var vd of this.videos) {
|
for(var vd of this.videos) {
|
||||||
vd.setvideoAlignment(videoAlignment)
|
vd.setVideoAlignment(videoAlignment)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -6,6 +6,7 @@ import ArDetector from '../ar-detect/ArDetector';
|
|||||||
class VideoData {
|
class VideoData {
|
||||||
|
|
||||||
constructor(video, settings, pageInfo){
|
constructor(video, settings, pageInfo){
|
||||||
|
this.vdid = (Math.random()*100).toFixed();
|
||||||
this.logger = pageInfo.logger;
|
this.logger = pageInfo.logger;
|
||||||
this.arSetupComplete = false;
|
this.arSetupComplete = false;
|
||||||
this.video = video;
|
this.video = video;
|
||||||
@ -14,7 +15,6 @@ class VideoData {
|
|||||||
this.pageInfo = pageInfo;
|
this.pageInfo = pageInfo;
|
||||||
this.extensionMode = pageInfo.extensionMode;
|
this.extensionMode = pageInfo.extensionMode;
|
||||||
|
|
||||||
this.vdid = (Math.random()*100).toFixed();
|
|
||||||
this.userCssClassName = `uw-fuck-you-and-do-what-i-tell-you_${this.vdid}`;
|
this.userCssClassName = `uw-fuck-you-and-do-what-i-tell-you_${this.vdid}`;
|
||||||
|
|
||||||
|
|
||||||
@ -244,8 +244,8 @@ class VideoData {
|
|||||||
this.resizer.setPanMode(mode);
|
this.resizer.setPanMode(mode);
|
||||||
}
|
}
|
||||||
|
|
||||||
setvideoAlignment(videoAlignment) {
|
setVideoAlignment(videoAlignment) {
|
||||||
this.resizer.setvideoAlignment(videoAlignment);
|
this.resizer.setVideoAlignment(videoAlignment);
|
||||||
}
|
}
|
||||||
|
|
||||||
restoreAr(){
|
restoreAr(){
|
||||||
|
@ -15,6 +15,7 @@ if(Debug.debug) {
|
|||||||
class Resizer {
|
class Resizer {
|
||||||
|
|
||||||
constructor(videoData) {
|
constructor(videoData) {
|
||||||
|
this.resizerId = (Math.random(99)*100).toFixed(0);
|
||||||
this.conf = videoData;
|
this.conf = videoData;
|
||||||
this.logger = videoData.logger;
|
this.logger = videoData.logger;
|
||||||
this.video = videoData.video;
|
this.video = videoData.video;
|
||||||
@ -37,7 +38,6 @@ class Resizer {
|
|||||||
this.videoAlignment = this.settings.getDefaultVideoAlignment(window.location.hostname); // this is initial video alignment
|
this.videoAlignment = this.settings.getDefaultVideoAlignment(window.location.hostname); // this is initial video alignment
|
||||||
this.destroyed = false;
|
this.destroyed = false;
|
||||||
|
|
||||||
this.resizerId = (Math.random(99)*100).toFixed(0);
|
|
||||||
|
|
||||||
if (this.settings.active.pan) {
|
if (this.settings.active.pan) {
|
||||||
this.canPan = this.settings.active.miscSettings.mousePan.enabled;
|
this.canPan = this.settings.active.miscSettings.mousePan.enabled;
|
||||||
@ -194,8 +194,8 @@ class Resizer {
|
|||||||
this.conf.destroy();
|
this.conf.destroy();
|
||||||
}
|
}
|
||||||
|
|
||||||
// // pause AR on basic stretch, unpause when using other mdoes
|
// pause AR on basic stretch, unpause when using other modes
|
||||||
// fir sine reason unpause doesn't unpause. investigate that later
|
// for sine reason unpause doesn't unpause. investigate that later
|
||||||
try {
|
try {
|
||||||
if (this.stretcher.mode === Stretch.Basic) {
|
if (this.stretcher.mode === Stretch.Basic) {
|
||||||
this.conf.arDetector.pause();
|
this.conf.arDetector.pause();
|
||||||
@ -218,7 +218,7 @@ class Resizer {
|
|||||||
this.conf.destroy();
|
this.conf.destroy();
|
||||||
}
|
}
|
||||||
if (stretchFactors.error === 'illegal_video_dimensions') {
|
if (stretchFactors.error === 'illegal_video_dimensions') {
|
||||||
this.loggger.log('error', 'debug', `[Resizer::setAr] <rid:${this.resizerId}> Illegal video dimensions found. We will pause everything.`)
|
this.logger.log('error', 'debug', `[Resizer::setAr] <rid:${this.resizerId}> Illegal video dimensions found. We will pause everything.`)
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -300,7 +300,7 @@ class Resizer {
|
|||||||
this.restore();
|
this.restore();
|
||||||
}
|
}
|
||||||
|
|
||||||
setvideoAlignment(videoAlignment) {
|
setVideoAlignment(videoAlignment) {
|
||||||
this.videoAlignment = videoAlignment;
|
this.videoAlignment = videoAlignment;
|
||||||
this.restore();
|
this.restore();
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user