Skip to content

Commit

Permalink
Bug fixes (#19)
Browse files Browse the repository at this point in the history
* minor bugfixes
  • Loading branch information
orthdron authored Aug 14, 2024
1 parent 0f784a8 commit ac8b31d
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 8 deletions.
2 changes: 1 addition & 1 deletion app/(default)/(authorized)/videos/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ export default async function MyVideos() {
.where('userId', '=', user.id)
.execute();

const publicUrl = process.env.PROCESSED_VIDEO_URL;
const publicUrl = process.env.PROCESSED_VIDEO_URL!.replace(/\/+$/, '');

if (!publicUrl) {
throw new Error("PROCESSED_VIDEO_URL is not defined");
Expand Down
4 changes: 2 additions & 2 deletions app/(default)/(public)/video/[id]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,15 +32,15 @@ export default async function Page({ params }: { params: { id: string } }) {
redirect('/');
}

const publicUrl = process.env.PROCESSED_VIDEO_URL;
const publicUrl = process.env.PROCESSED_VIDEO_URL!.replace(/\/+$/, '');
if (!publicUrl) {
throw new Error("PROCESSED_VIDEO_URL is not defined");
}

const videoProps = {
url: `${publicUrl}/${id}/master.m3u8`,
vtt: `${publicUrl}/${id}/sprite.vtt`,
poster: `${publicUrl}/${id}/poster.jpeg`,
poster: `${publicUrl}/${id}/poster.jpg`,
...video
};

Expand Down
4 changes: 2 additions & 2 deletions app/embed/[id]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,15 +29,15 @@ export default async function Page({ params }: { params: { id: string } }) {
redirect('/');
}

const publicUrl = process.env.PROCESSED_VIDEO_URL;
const publicUrl = process.env.PROCESSED_VIDEO_URL!.replace(/\/+$/, '');
if (!publicUrl) {
throw new Error("PROCESSED_VIDEO_URL is not defined");
}

const videoProps = {
url: `${publicUrl}/${id}/master.m3u8`,
vtt: `${publicUrl}/${id}/sprite.vtt`,
poster: `${publicUrl}/${id}/poster.jpeg`,
poster: `${publicUrl}/${id}/poster.jpg`,
...video
};

Expand Down
2 changes: 1 addition & 1 deletion components/video/VideoThumbnail.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import VideoThumbnailHover from "./videoThumbnailHover";
export default function VideoThumbnail({ video }: { video: { id: string; title: string } }) {

const { id, title } = video;
const baseUrl = process.env.PROCESSED_VIDEO_URL!;
const baseUrl = process.env.PROCESSED_VIDEO_URL!.replace(/\/+$/, '');


return (
Expand Down
5 changes: 3 additions & 2 deletions lib/s3.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,10 @@ export function createS3Client() {
},
forcePathStyle: true,
region: region,
endpoint: endpoint
};

if (endpoint) {
s3ClientConfig.endpoint = endpoint;
}

// Create and return the S3 client
const s3client = new S3Client(s3ClientConfig);
Expand Down

0 comments on commit ac8b31d

Please sign in to comment.