Fixed media replacement broken when <source> elements are used.

This commit is contained in:
hackademix 2019-06-15 20:42:39 +02:00
parent a4f088211e
commit 48d03247ff
1 changed files with 5 additions and 1 deletions

View File

@ -34,7 +34,7 @@ var PlaceHolder = (() => {
new Handler("frame", "iframe");
new Handler("object", "object, embed");
new Handler("media", "video, audio");
new Handler("media", "video, audio, source");
function cloneStyle(src, dest,
props = ["width", "height", "position", "*", "margin*"]) {
@ -106,6 +106,10 @@ var PlaceHolder = (() => {
replace(element) {
if (!element.parentElement) return;
if (element.parentElement instanceof HTMLMediaElement) {
this.replace(element.parentElement);
return;
}
let {
url
} = this.request;