Log basurl

This commit is contained in:
austinkelsay 2024-10-04 17:02:20 -05:00
parent 153be7cb20
commit be72bd2c11
2 changed files with 3 additions and 1 deletions

View File

@ -63,6 +63,7 @@ const VideoForm = ({ draft = null }) => {
}
else if (videoUrl.includes('.mp4') || videoUrl.includes('.mov') || videoUrl.includes('.avi') || videoUrl.includes('.wmv') || videoUrl.includes('.flv') || videoUrl.includes('.webm')) {
const baseUrl = process.env.NEXT_PUBLIC_API_URL || "http://localhost:3000";
console.log("BASE URL", baseUrl);
const videoEmbed = `<div style="position:relative;padding-bottom:56.25%;height:0;overflow:hidden;max-width:100%;"><video src="${baseUrl}/api/get-video-url?videoKey=${encodeURIComponent(videoUrl)}" style="position:absolute;top:0;left:0;width:100%;height:100%;border:0;" controls></video></div>`;
embedCode = videoEmbed;
}

View File

@ -220,7 +220,8 @@ export default function Draft() {
// todo update this for dev and prod
const extractedVideoId = draft.content.split('?videoKey=')[1].split('"')[0];
videoId = extractedVideoId;
const baseUrl = process.env.NEXT_PUBLIC_API_URL || "http://localhost:3000"
const baseUrl = process.env.NEXT_PUBLIC_API_URL || "http://localhost:3000";
console.log("BASE URL", baseUrl);
const videoEmbed = `<div style="position:relative;padding-bottom:56.25%;height:0;overflow:hidden;max-width:100%;"><video src="${baseUrl}/api/get-video-url?videoKey=${encodeURIComponent(extractedVideoId)}" style="position:absolute;top:0;left:0;width:100%;height:100%;border:0;" controls></video></div>`;
if (draft?.price) {
const encryptedVideoUrl = await encryptContent(videoEmbed);