Skip to content

Commit

Permalink
fix: 修复超星重复暂停的BUG
Browse files Browse the repository at this point in the history
  • Loading branch information
enncy committed Apr 4, 2022
1 parent 0d53810 commit c5c7681
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 0 additions & 1 deletion packages/core/src/cx/study.ts
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,6 @@ function mediaTask(setting: ScriptSettings["cx"]["video"], media: HTMLMediaEleme

if (!isPlaying) {
media.play();
media.playbackRate = playbackRate;
}
}, 1000)
);
Expand Down
2 changes: 2 additions & 0 deletions packages/core/src/cx/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@ import { logger } from "../logger";
*/
export function rateHack() {
try {
hack();
window.document.addEventListener("readystatechange", hack);
window.addEventListener("load", hack);
} catch (e) {
console.error(e.message);
}
Expand Down

0 comments on commit c5c7681

Please sign in to comment.