captions for mv

This commit is contained in:
vapormusic 2021-12-07 22:25:04 +07:00
parent 9ac4c753dd
commit d710254ba8
3 changed files with 17 additions and 2 deletions

View file

@ -140,7 +140,8 @@ const app = new Vue({
this.mk.addEventListener(MusicKit.Events.playbackTimeDidChange, (a) => {
self.playerLCD.playbackDuration = (self.mk.currentPlaybackTime)
self.lyriccurrenttime = app.mk.currentPlaybackTime;
app.getActiveLyric()
if (self.lyricon) app.getActiveLyric();
// animated dot like AM - bad perf
if (self.lyricon && self.drawertest){
let currentLine = document.querySelector(`.lyric-line.active`)

View file

@ -2011,4 +2011,17 @@ input[type=range].web-slider::-webkit-slider-runnable-track {
img[src=""] {
text-indent: -10000px;
}
div#captions {
font-size: 1.2rem;
position: absolute;
top: 85%;
text-align: center;
width: auto;
align-self: center;
left: 50%;
transform: translate(-50%, -50%);
background: rgba(0,0,0,0.6);
color: yellow;
}

View file

@ -100,7 +100,7 @@
</div>
<div class="app-chrome-item generic">
<button class="playback-button--small lyrics"
@click="drawertest = !drawertest; lyricon =!lyricon; if(drawertest == true){loadLyrics();}"></button>
@click=" lyricon =!lyricon; if( document.getElementById(`apple-music-video-container`).style.display != `block`){drawertest = !drawertest}; "></button>
</div>
<div class="app-chrome-item full-height">
<div class="window-controls">
@ -341,6 +341,7 @@
fill-rule="nonzero" />
</svg>
</div>
<div id="captions">{{(app.lyricon) ? ((app.lyrics.length > 0 ) ? app.lyrics[app.currentLyricsLine].line.replace('lrcInstrumental','') : "") : ''}}</div>
<div id="player-pip" @click="document.querySelector('video').requestPictureInPicture()"
title="Picture-in-Picture">
<%- include("svg/fullscreen.svg") %>