mirror of
https://github.com/zhw2590582/ArtPlayer.git
synced 2026-10-25 16:11:20 -08:00
压缩字符
This commit is contained in:
1 parent
7ff61b4660
commit
0cf455ced3
27 files changed
+171
-239
No files matched your search
@@ -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':
|
||||
|
||||
Reference in new issue
Block a user