Skip to content

Commit

Permalink
Merge pull request #147 from canopas/fix-video-preview
Browse files Browse the repository at this point in the history
Fix preview urls
  • Loading branch information
cp-sumi-k committed Feb 15, 2024
2 parents c48b86b + 29370d2 commit 61259d9
Showing 1 changed file with 19 additions and 10 deletions.
29 changes: 19 additions & 10 deletions admin/src/api/post/content-types/post/lifecycles.js
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,7 @@ async function generatePreview(event) {
for (const element of embeds) {
let string = "";
if (["mp4", "webm"].some((v) => element.attributes.url.value.includes(v))) {
string = `<video style="margin:auto" autoplay loop muted>
string = `<video style="margin:auto;max-height:70vh" autoplay loop muted>
<source src="${element.attributes.url.value}" type="video/mp4">
Your browser does not support the video tag.
</video>`;
Expand Down Expand Up @@ -309,23 +309,31 @@ async function generatePreview(event) {
>
<h2
style="
max-height:40px;
margin: 0 !important;
overflow: hidden;
color: #242424;
text-overflow: ellipsis;
font-size: 16px !important;
color: #242424;
font-weight: 700;
margin: 0 !important;
-webkit-line-clamp: 2;
-webkit-box-orient:vertical;
"
>
${data.title}
</h2>
<div class="desc" style="margin-top: 8px">
<div style="margin-top: 8px">
<h3
style="
max-height:40px;
margin: 0 !important;
overflow: hidden;
color: #6b6b6b;
text-overflow: ellipsis;
font-size: 16px !important;
color: #6b6b6b;
line-height: 20px;
margin: 0 !important;
-webkit-line-clamp: 2;
-webkit-box-orient:vertical;
"
>
${data.description}
Expand All @@ -334,12 +342,13 @@ async function generatePreview(event) {
<div>
<p
style="
max-height:40px;
margin: 0 !important;
color: #6b6b6b;
font-size: 13px !important;
-webkit-line-clamp: 2;
max-height: 40px;
-webkit-box-orient:vertical;
text-overflow: ellipsis;
font-size: 13px !important;
color: #6b6b6b;
margin: 0 !important;
"
>
${data.domain}
Expand Down

0 comments on commit 61259d9

Please sign in to comment.