Skip to content

Commit

Permalink
example: try setting callback / hook in config
Browse files Browse the repository at this point in the history
  • Loading branch information
luwes committed Oct 9, 2024
1 parent 4bd2678 commit ddbb92a
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion examples/default-provider/next.config.mjs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { withNextVideo } from 'next-video/process';
import { readFile } from 'node:fs/promises';

/** @type {import('next').NextConfig} */
const nextConfig = (phase, { defaultConfig }) => {
Expand All @@ -7,7 +8,14 @@ const nextConfig = (phase, { defaultConfig }) => {
};
};

export default withNextVideo(nextConfig);
export default withNextVideo(nextConfig, {
loadAsset: async function (assetPath) {
console.warn(99, assetPath);
const file = await readFile(assetPath);
const asset = JSON.parse(file.toString());
return asset;
},
});

// Amazon S3 example
// export default withNextVideo(nextConfig, {
Expand Down

0 comments on commit ddbb92a

Please sign in to comment.