Skip to content

Commit

Permalink
Fix: subtitle need deep copy
Browse files Browse the repository at this point in the history
  • Loading branch information
zijiren233 committed May 10, 2024
1 parent 5bee4b5 commit ea5ea5d
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions src/views/Cinema.vue
Original file line number Diff line number Diff line change
Expand Up @@ -164,15 +164,18 @@ const playerOption = computed<options>(() => {
let defaultUrl;
let useAssPlugin = false;
for (let key in room.currentMovie.base!.subtitles) {
if (room.currentMovie.base!.subtitles[key].type === "ass") {
// deep copy
const subtitle = Object.assign({}, room.currentMovie.base!.subtitles);
for (let key in subtitle) {
if (subtitle[key].type === "ass") {
useAssPlugin = true;
defaultUrl = room.currentMovie.base!.subtitles[key].url;
defaultUrl = subtitle[key].url;
break;
}
}
option.plugins!.push(newLazyInitSubtitlePlugin(room.currentMovie.base!.subtitles));
option.plugins!.push(newLazyInitSubtitlePlugin(subtitle));
// return;
useAssPlugin &&
option.plugins!.push(
Expand Down

0 comments on commit ea5ea5d

Please sign in to comment.