next-video
Version:
A React component for adding video to your Next.js application. It extends both the video element and your Next app with features for automatic video optimization.
20 lines (19 loc) • 663 B
JavaScript
import { videoHandler, callHandler } from "./video-handler.js";
import { uploadLocalFile } from "./handlers/local-upload.js";
import { uploadRequestedFile } from "./handlers/api-request.js";
import log from "./utils/logger.js";
import { NextVideo } from "./setup-next-video.js";
import { withNextVideo } from "./with-next-video.js";
try {
videoHandler("local.video.added", uploadLocalFile);
videoHandler("request.video.added", uploadRequestedFile);
} catch (err) {
log.error("An exception occurred within next-video. You may need to restart your dev server.");
console.error(err);
}
export {
NextVideo,
callHandler,
videoHandler,
withNextVideo
};