unsynced ttml
This commit is contained in:
parent
9798ad170a
commit
07d44ceba3
1 changed files with 12 additions and 1 deletions
|
@ -159,6 +159,7 @@ const app = new Vue({
|
||||||
self.playerLCD.playbackDuration = (self.mk.currentPlaybackTime)
|
self.playerLCD.playbackDuration = (self.mk.currentPlaybackTime)
|
||||||
self.lyriccurrenttime = app.mk.currentPlaybackTime;
|
self.lyriccurrenttime = app.mk.currentPlaybackTime;
|
||||||
|
|
||||||
|
// animated dot like AM - bad perf
|
||||||
if (self.lyricon && self.drawertest){
|
if (self.lyricon && self.drawertest){
|
||||||
let currentLine = document.querySelector(`.lyric-line.active`)
|
let currentLine = document.querySelector(`.lyric-line.active`)
|
||||||
if (currentLine && currentLine.getElementsByClassName('lyricWaiting').length > 0){
|
if (currentLine && currentLine.getElementsByClassName('lyricWaiting').length > 0){
|
||||||
|
@ -399,8 +400,13 @@ const app = new Vue({
|
||||||
let preLrc = [];
|
let preLrc = [];
|
||||||
let xml = this.stringToXml(this.lyricsMediaItem);
|
let xml = this.stringToXml(this.lyricsMediaItem);
|
||||||
let lyricsLines = xml.getElementsByTagName('p');
|
let lyricsLines = xml.getElementsByTagName('p');
|
||||||
|
let synced = true;
|
||||||
let endTimes = [];
|
let endTimes = [];
|
||||||
|
if (xml.getElementsByTagName('tt')[0].getAttribute("itunes:timing") === "None"){
|
||||||
|
synced = false;
|
||||||
|
}
|
||||||
endTimes.push(0);
|
endTimes.push(0);
|
||||||
|
if (synced) {
|
||||||
for (element of lyricsLines){
|
for (element of lyricsLines){
|
||||||
start = this.toMS(element.getAttribute('begin'))
|
start = this.toMS(element.getAttribute('begin'))
|
||||||
end = this.toMS(element.getAttribute('end'))
|
end = this.toMS(element.getAttribute('end'))
|
||||||
|
@ -413,8 +419,13 @@ const app = new Vue({
|
||||||
// first line dot
|
// first line dot
|
||||||
if (preLrc.length > 0)
|
if (preLrc.length > 0)
|
||||||
preLrc.unshift({startTime: 0,endTime: preLrc[0].startTime, line: "lrcInstrumental"});
|
preLrc.unshift({startTime: 0,endTime: preLrc[0].startTime, line: "lrcInstrumental"});
|
||||||
|
} else {
|
||||||
|
for (element of lyricsLines){
|
||||||
|
preLrc.push({startTime: 9999999 ,endTime: 9999999 , line: element.textContent});
|
||||||
|
}
|
||||||
|
}
|
||||||
this.lyrics = preLrc;
|
this.lyrics = preLrc;
|
||||||
|
|
||||||
},
|
},
|
||||||
parseLyrics() {
|
parseLyrics() {
|
||||||
var xml = this.stringToXml(this.lyricsMediaItem)
|
var xml = this.stringToXml(this.lyricsMediaItem)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue