mirror of
https://github.com/mediacms-io/mediacms.git
synced 2026-05-07 21:03:53 -04:00
a
This commit is contained in:
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -143,6 +143,26 @@ export default class IframeEmbed {
|
|||||||
return `${w} / ${h}`;
|
return `${w} / ${h}`;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
buildTextLinkUrl(parsed, options) {
|
||||||
|
let viewUrl;
|
||||||
|
if (parsed.isGeneric || parsed.isLtiLaunch) {
|
||||||
|
viewUrl = parsed.rawUrl;
|
||||||
|
} else {
|
||||||
|
viewUrl = `${parsed.baseUrl}/view?m=${parsed.videoId}`;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (options.startAtEnabled && options.startAt) {
|
||||||
|
const seconds = this.timeStringToSeconds(options.startAt);
|
||||||
|
if (seconds !== null && seconds > 0) {
|
||||||
|
const url = new URL(viewUrl);
|
||||||
|
url.searchParams.set('t', seconds.toString());
|
||||||
|
viewUrl = url.toString();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return viewUrl;
|
||||||
|
}
|
||||||
|
|
||||||
buildEmbedUrl(parsed, options) {
|
buildEmbedUrl(parsed, options) {
|
||||||
if (parsed.isGeneric) {
|
if (parsed.isGeneric) {
|
||||||
return parsed.rawUrl;
|
return parsed.rawUrl;
|
||||||
@@ -361,12 +381,7 @@ export default class IframeEmbed {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (values.textLinkOnly) {
|
if (values.textLinkOnly) {
|
||||||
let viewUrl;
|
const viewUrl = this.buildTextLinkUrl(parsed, values);
|
||||||
if (parsed.isGeneric || parsed.isLtiLaunch) {
|
|
||||||
viewUrl = parsed.rawUrl;
|
|
||||||
} else {
|
|
||||||
viewUrl = `${parsed.baseUrl}/view?m=${parsed.videoId}`;
|
|
||||||
}
|
|
||||||
|
|
||||||
const escapeHtml = (str) => {
|
const escapeHtml = (str) => {
|
||||||
const div = document.createElement('div');
|
const div = document.createElement('div');
|
||||||
@@ -430,12 +445,7 @@ export default class IframeEmbed {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (values.textLinkOnly) {
|
if (values.textLinkOnly) {
|
||||||
let viewUrl;
|
const viewUrl = this.buildTextLinkUrl(parsed, values);
|
||||||
if (parsed.isGeneric || parsed.isLtiLaunch) {
|
|
||||||
viewUrl = parsed.rawUrl;
|
|
||||||
} else {
|
|
||||||
viewUrl = `${parsed.baseUrl}/view?m=${parsed.videoId}`;
|
|
||||||
}
|
|
||||||
|
|
||||||
const escapeHtml = (str) => {
|
const escapeHtml = (str) => {
|
||||||
const div = document.createElement('div');
|
const div = document.createElement('div');
|
||||||
|
|||||||
Reference in New Issue
Block a user