压缩字符

This commit is contained in:
Harvey committed 2019-11-28 10:56:53 +08:00
1 parent 7ff61b4660
commit 0cf455ced3
27 files changed
+171 -239

No files matched your search

+4 -4
View File
@@ -43,9 +43,9 @@ export default class Subtitle extends Component {
}
}
switch(url, name) {
switch(url, name, ext) {
const { i18n, notice } = this.art;
return this.init(url).then(subUrl => {
return this.init(url, ext).then(subUrl => {
if (name) {
notice.show = `${i18n.get('Switch subtitle')}: ${name}`;
}
@@ -54,7 +54,7 @@ export default class Subtitle extends Component {
});
}
init(url) {
init(url, ext) {
const {
notice,
template: { $subtitle, $track },
@@ -66,7 +66,7 @@ export default class Subtitle extends Component {
})
.then(text => {
this.art.emit('subtitle:load', url);
switch (getExt(url)) {
switch (ext || getExt(url)) {
case 'srt':
return vttToBlob(srtToVtt(text));
case 'ass':