Community

개발자 99% 커뮤니티에서 수다 떨어요!

← Go back
유튜브 클론코딩 78% 정도 들었는데 비디오 녹화없이 썸네일 얻는법
#ask
3 weeks ago
1,523
1

유튜브 클론코딩 78% 정도 들었는데 비디오 녹화 세션이 나오더라구요?
그런데 웹캠이 없는 슬픈 중생은 그 세션에 있는 썸네일 만들기를 따라하지 못했습니다
혹시 비디오 녹화를 안하더라도 db에 있는 비디오에서 썸네일을 추출해서 홈에 보여주는 방법이 있을 까요..??

export const postUpload = async (req, res) => {

const { user: { _id }, } = req.session;

const { path: fileUrl } = req.file;

const { title, description, hashtags } = req.body;

try { const newVideo = await Video.create({ title, description, fileUrl, owner: _id, hashtags: Video.formatHashtags(hashtags), });

const user = await User.findById(_id); user.videos.push(newVideo._id); user.save(); return res.redirect("/"); }

catch (error) { return res.status(400).render("upload", { pageTitle: "Upload Video", errorMessage: error._message, }); } };

여기서 어떻게 하면 될 것 같은데 흑흑
도움 부탁드립니다

1 comment