Skip to content

Commit

Permalink
Attempt to fix videoUploadingWebCodecs redirect again (#368)
Browse files Browse the repository at this point in the history
define BASE_PATH so we don't try to evaluate it at runtime. It is
only defined in the environment at build time.
  • Loading branch information
austinEng authored Mar 6, 2024
1 parent 95137ca commit bcba0c6
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
1 change: 1 addition & 0 deletions next.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ module.exports = {
const source = fs.readFileSync(v.module.userRequest, 'utf-8');
return JSON.stringify(source); // Strings need to be wrapped in quotes
}, []),
BASE_PATH: JSON.stringify(process.env.BASE_PATH || ''),
})
);

Expand Down
4 changes: 1 addition & 3 deletions src/pages/samples/videoUploadingWebCodecs.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,7 @@ function Page(): JSX.Element {
<Head>
<meta
httpEquiv="refresh"
content={`0; url=${
process.env.BASE_PATH || ''
}/samples/videoUploading?videoSource=videoFrame`}
content={`0; url=${BASE_PATH}/samples/videoUploading?videoSource=videoFrame`}
></meta>
</Head>
);
Expand Down
1 change: 1 addition & 0 deletions src/types.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ interface HTMLCanvasElement extends HTMLElement {
}

declare const __SOURCE__: string;
declare const BASE_PATH: string;

// Defined by webpack.
declare namespace NodeJS {
Expand Down

0 comments on commit bcba0c6

Please sign in to comment.