Merge pull request #1444 from dpalou/MOBILE-2476

MOBILE-2476 media: Fix embedded media download in iOS
main
Juan Leyva 2018-08-22 10:40:40 +01:00 committed by GitHub
commit 062041d59a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 0 deletions

View File

@ -189,6 +189,12 @@ export class CoreExternalContentDirective implements AfterViewInit {
}
return promise.then((finalUrl) => {
if (finalUrl.match(/^https?:\/\//i)) {
/* In iOS, if we use the same URL in embedded file and background download then the download only
downloads a few bytes (cached ones). Add a hash to the URL so both URLs are different. */
finalUrl = finalUrl + '#moodlemobile-embedded';
}
this.logger.debug('Using URL ' + finalUrl + ' for ' + url);
if (tagName === 'SOURCE') {
// The browser does not catch changes in SRC, we need to add a new source.