Skip to content

Commit

Permalink
Merge pull request #903 from ilyhalight/dev
Browse files Browse the repository at this point in the history
Updated chaimu to 1.0.3
  • Loading branch information
ilyhalight authored Nov 9, 2024
2 parents 09c8523 + 45064e7 commit 86d5b74
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 10 deletions.
Binary file modified bun.lockb
Binary file not shown.
1 change: 1 addition & 0 deletions changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
- Добавлена возможность использования эксперементальной вариации голосов Яндекса. Новые голоса работают, только при некоторых условиях, во всех остальных случаях используются старые (#897)
- Добавлен обход кэша при получение перевода интерфейса после нажатия на кнопку "Обновить файлы локализации"
- Исправлена некорректная генерация Sec-{Vsubs|Vtrans}-Token заголовков ([vot.js#36](https://github.com/FOSWLY/vot.js/issues/36))
- Исправлена ошибка из-за которой старый плеер не добавлял lipsync эвенты после первого выключения перевода (#902, #894, возможно #887)

# 1.7.1

Expand Down
4 changes: 2 additions & 2 deletions dist/vot-min.user.js

Large diffs are not rendered by default.

22 changes: 15 additions & 7 deletions dist/vot.user.js
Original file line number Diff line number Diff line change
Expand Up @@ -7670,7 +7670,7 @@ class VideoObserver {

;// ./node_modules/chaimu/dist/config.js
/* harmony default export */ const dist_config = ({
version: "1.0.2",
version: "1.0.3",
debug: false,
fetchFn: fetch.bind(window),
});
Expand Down Expand Up @@ -8575,8 +8575,7 @@ class AudioPlayer extends BasePlayer {
audioSource;
constructor(chaimu, src) {
super(chaimu, src);
this.audio = new Audio(src);
this.audio.crossOrigin = "anonymous";
this.updateAudio();
}
initAudioBooster() {
if (!this.chaimu.audioContext) {
Expand All @@ -8592,8 +8591,14 @@ class AudioPlayer extends BasePlayer {
this.audioSource.connect(this.gainNode);
return this;
}
updateAudio() {
this.audio = new Audio(this.src);
this.audio.crossOrigin = "anonymous";
return this;
}
async init() {
return new Promise((resolve) => {
this.updateAudio();
this.initAudioBooster();
return resolve(this);
});
Expand Down Expand Up @@ -10119,8 +10124,9 @@ class VideoHandler {

this.votVideoVolumeSlider.input.addEventListener("input", (e) => {
const value = Number(e.target.value);
this.votVideoVolumeSlider.label.querySelector("strong").textContent =
`${value}%`;
this.votVideoVolumeSlider.label.querySelector(
"strong",
).textContent = `${value}%`;
this.setVideoVolume(value / 100);
if (this.data.syncVolume) {
this.syncVolumeWrapper("video", value);
Expand Down Expand Up @@ -10979,8 +10985,9 @@ class VideoHandler {
const newSlidersVolume = Math.round(videoVolume);

this.votVideoVolumeSlider.input.value = newSlidersVolume;
this.votVideoVolumeSlider.label.querySelector("strong").textContent =
`${newSlidersVolume}%`;
this.votVideoVolumeSlider.label.querySelector(
"strong",
).textContent = `${newSlidersVolume}%`;
ui.updateSlider(this.votVideoVolumeSlider.input);

if (this.data.syncVolume === 1) {
Expand Down Expand Up @@ -11272,6 +11279,7 @@ class VideoHandler {
try {
this.audioPlayer.init();
} catch (err) {
debug.log("this.audioPlayer.init() error", err);
if (err.message.includes("Failed to fetch audio file")) {
this.videoHandler.data.audioProxy = 1;
await votStorage.set("audioProxy", 1);
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
},
"dependencies": {
"bowser": "^2.11.0",
"chaimu": "^1.0.2",
"chaimu": "^1.0.3",
"lit": "^3.2.1",
"requestidlecallback-polyfill": "^1.0.2",
"vot.js": "^1.3.10"
Expand Down
1 change: 1 addition & 0 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2378,6 +2378,7 @@ class VideoHandler {
try {
this.audioPlayer.init();
} catch (err) {
debug.log("this.audioPlayer.init() error", err);
if (err.message.includes("Failed to fetch audio file")) {
this.videoHandler.data.audioProxy = 1;
await votStorage.set("audioProxy", 1);
Expand Down

0 comments on commit 86d5b74

Please sign in to comment.