Skip to content

Commit

Permalink
Muted video and added controls (#179)
Browse files Browse the repository at this point in the history
  • Loading branch information
csharpfritz authored Sep 5, 2023
1 parent 7f74014 commit 45a7cc1
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/TagzApp.Web/wwwroot/js/site.js
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@
<div class="content">${content.text}</div>`;

if (content.previewCard) {
const tag = content.previewCard.imageUri.split('.').pop() == "mp4" ? "video autoplay" : "img";
const tag = content.previewCard.imageUri.split('.').pop() == "mp4" ? "video muted='muted' controls='controls' autoplay" : "img";
newMessage.innerHTML += `
<div class="contentcard">
<${tag} src="${content.previewCard.imageUri}" class="card-img-top" alt="${content.previewCard.altText}" />
Expand Down Expand Up @@ -114,7 +114,7 @@
let modalBody = document.querySelector(".modal-body").innerHTML = content.text;

if (content.previewCard) {
const tag = content.previewCard.imageUri.split('.').pop() == "mp4" ? "video autoplay" : "img";
const tag = content.previewCard.imageUri.split('.').pop() == "mp4" ? "video muted='muted' controls='controls' autoplay" : "img";
document.querySelector(".modal-body").innerHTML += `
<div class="contentcard">
<${tag} src="${content.previewCard.imageUri}" class="card-img-top" alt="${content.previewCard.altText}" />
Expand Down

0 comments on commit 45a7cc1

Please sign in to comment.