MOBILE-3320 android: Fix subtitles in videos not seen
parent
4a34dab790
commit
9ddce87347
|
@ -188,7 +188,7 @@ export class CoreExternalContentDirective implements AfterViewInit, OnChanges {
|
||||||
if (tagName == 'VIDEO' && targetAttr != 'poster') {
|
if (tagName == 'VIDEO' && targetAttr != 'poster') {
|
||||||
const video = <HTMLVideoElement> this.element;
|
const video = <HTMLVideoElement> this.element;
|
||||||
if (video.textTracks) {
|
if (video.textTracks) {
|
||||||
// It's a video with subtitles. In iOS, subtitles position is wrong so it needs to be fixed.
|
// It's a video with subtitles. Fix some issues with subtitles.
|
||||||
video.textTracks.onaddtrack = (event): void => {
|
video.textTracks.onaddtrack = (event): void => {
|
||||||
const track = <TextTrack> event.track;
|
const track = <TextTrack> event.track;
|
||||||
if (track) {
|
if (track) {
|
||||||
|
@ -248,6 +248,11 @@ export class CoreExternalContentDirective implements AfterViewInit, OnChanges {
|
||||||
true,
|
true,
|
||||||
downloadUnknown,
|
downloadUnknown,
|
||||||
);
|
);
|
||||||
|
} else if (tagName === 'TRACK') {
|
||||||
|
// Download tracks right away. Using an online URL for tracks can give a CORS error in Android.
|
||||||
|
finalUrl = await CoreFilepool.downloadUrl(site.getId(), url, false, this.component, this.componentId);
|
||||||
|
|
||||||
|
finalUrl = CoreFile.convertFileSrc(finalUrl);
|
||||||
} else {
|
} else {
|
||||||
finalUrl = await CoreFilepool.getUrlByUrl(
|
finalUrl = await CoreFilepool.getUrlByUrl(
|
||||||
site.getId(),
|
site.getId(),
|
||||||
|
|
Loading…
Reference in New Issue