feat: rename IPC

This commit is contained in:
JellyBrick
2024-01-06 10:17:40 +09:00
parent 5d5cc58f59
commit 6b7c43925a
26 changed files with 88 additions and 73 deletions

View File

@ -37,8 +37,8 @@ interface YouTubeMusicAppElement extends HTMLElement {
}
async function onApiLoaded() {
window.ipcRenderer.on('seekTo', (_, t: number) => api!.seekTo(t));
window.ipcRenderer.on('seekBy', (_, t: number) => api!.seekBy(t));
window.ipcRenderer.on('ytmd:seek-to', (_, t: number) => api!.seekTo(t));
window.ipcRenderer.on('ytmd:seek-by', (_, t: number) => api!.seekBy(t));
const video = document.querySelector('video')!;
const audioContext = new AudioContext();
@ -65,7 +65,7 @@ async function onApiLoaded() {
const audioCanPlayEventDispatcher = () => {
document.dispatchEvent(
new CustomEvent('audioCanPlay', {
new CustomEvent('ytmd:audio-can-play', {
detail: {
audioContext,
audioSource,