-
Notifications
You must be signed in to change notification settings - Fork 32
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* example: try setting callback / hook in config * fix: add setup config decoupled from Next * fix: config tests * fix: post request for pages router * fix: allow asset create on GET in dev mode * fix: pages route handler, use body url * fix: useInterval stuck running in CI * docs: add metadata storage hooks docs * docs: add ESM config * docs: clean up
- Loading branch information
Showing
14 changed files
with
234 additions
and
82 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
export { GET } from 'next-video/request-handler'; | ||
//export { GET } from 'next-video/request-handler'; | ||
export { GET, POST } from '@/next-video'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import { NextVideo } from 'next-video/process'; | ||
import { readFile } from 'fs/promises'; | ||
|
||
export const { GET, POST, handler, withNextVideo } = NextVideo({ | ||
loadAsset: async function (assetPath) { | ||
console.warn(99, assetPath); | ||
const file = await readFile(assetPath); | ||
const asset = JSON.parse(file.toString()); | ||
return asset; | ||
}, | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
examples/default-provider/videos/storage.googleapis.com_muxdemofiles_mux.mp4.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
{"status":"ready","originalFilePath":"https://storage.googleapis.com/muxdemofiles/mux.mp4","provider":"mux","providerMetadata":{"mux":{"assetId":"EploFGgmKULMpiyDFwsy5c6lmGcg8dkObaVvnPMcdkQ","playbackId":"jxEf6XiJs6JY017pSzpv8Hd6tTbdAOecHTq4FiFAn564"}},"createdAt":1710979438730,"updatedAt":1710979441038,"sources":[{"src":"https://stream.mux.com/jxEf6XiJs6JY017pSzpv8Hd6tTbdAOecHTq4FiFAn564.m3u8","type":"application/x-mpegURL"}],"poster":"https://image.mux.com//thumbnail.webp","blurDataURL":"data:image/webp;base64,UklGRlAAAABXRUJQVlA4IEQAAACwAQCdASoQAAkAAQAcJZwAAueBHFYwAP7+sPJ01xp5AM+XuhDsRQ67ZYXXhHDkrqsIkUGjQSCMuENc5y3Qg0o9pZgAAA=="} | ||
{"status":"ready","originalFilePath":"https://storage.googleapis.com/muxdemofiles/mux.mp4","provider":"mux","providerMetadata":{"mux":{"assetId":"z5Uxnqzcjrpjx01eea00RCl5DjWXcgj8EWW0100F1Iw9id8","playbackId":"lC32n4JjLfdFWmfCPTSvF2DR1D016VuhDovLyFgWDddE"}},"createdAt":1728945484374,"updatedAt":1728945487203,"sources":[{"src":"https://stream.mux.com/lC32n4JjLfdFWmfCPTSvF2DR1D016VuhDovLyFgWDddE.m3u8","type":"application/x-mpegURL"}],"poster":"https://image.mux.com/lC32n4JjLfdFWmfCPTSvF2DR1D016VuhDovLyFgWDddE/thumbnail.webp","blurDataURL":"data:image/webp;base64,UklGRlAAAABXRUJQVlA4IEQAAACwAQCdASoQAAkAAQAcJZwAAueBHFYwAP7+sPJ01xp5AM+XuhDsRQ67ZYXXhHDkrqsIkUGjQSCMuENc5y3Qg0o9pZgAAA=="} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import { setVideoConfig } from './config.js'; | ||
import handler, { GET, POST } from './request-handler.js'; | ||
import { withNextVideo as withNextVideoInternal } from './with-next-video.js'; | ||
import type { VideoConfig } from './config.js'; | ||
import type { NextConfig } from 'next'; | ||
|
||
export function NextVideo(config?: VideoConfig) { | ||
setVideoConfig(config); | ||
|
||
const withNextVideo = (nextConfig: NextConfig) => { | ||
return withNextVideoInternal(nextConfig, config); | ||
}; | ||
|
||
return { | ||
GET, | ||
POST, | ||
handler, | ||
withNextVideo, | ||
}; | ||
} |
Oops, something went wrong.