'웹' 태그의 글 목록 (3 Page)
본문 바로가기
728x90
반응형

24

비디오 업로드 하기 이렇게 비슷하다고 생각하다고 알고 있으면 좋습니다. 우선 해야하는것은 비디오의 collection을 만들어야합니다. 거기에 들어가는 것이 Video + writer + title + description + privacy + filePath + category + views + duration + thumbnail 이렇게 들어간다 생각합시다. 1. server의 models에 가서 Video.js를 만들어줍니다. const mongoose = require('mongoose'); const Schema = mongoose.Schema; const videoSchema = mongoose.Schema({ writer : { type: Schema.Types.ObjectId, ref: 'User'//이렇게 .. 2021. 3. 3.
ffmpeg를 이용하여 비디오 썸네일 만들기 우선 라이브러리 설치를 먼저 해야합니다. npm install fluent-ffmpeg 하기전에 ffmpeg.org/download.html Download FFmpeg If you find FFmpeg useful, you are welcome to contribute by donating. More downloading options Git Repositories Since FFmpeg is developed with Git, multiple repositories from developers and groups of developers are available. Releases Approximately every 6 ffmpeg.org 이사이트에서 다운을 해야합니다. 빨간 동그라미 의 links를 .. 2021. 3. 1.
Multer 이용 서버에 비디오 저장 onDrop 구현을 해주고 const onDrop = (files)=>{ let forData = new forData; const config = { header : {'content-type': 'multipart/form-data'} } forData.append("file",files[0])//첫번째 가져오기 위해 array 사용 // console.log(files)//파일의 파라미터가 저장됨 Axios.post('/api/video/uploadfiles',forData,config) .then(response=>{ if(response.data.success){ }else{ alert('비디오 업로드를 실패했습니다.') } }) } 우선 이렇게 선언하고 그전에 서버를 구현을 안해놨으니 구현을 .. 2021. 2. 28.
비디오 업로드 만들기 2 state를 만들건데 현재 VideoUploadPage를 보게 되면 onChage나 value 이런 것이 있는데 이를 state로 만들고 한번에 서버로 보낼 것이다. const [VideoTitle, setTitle] = useState("") 이렇게 선언을 해주고 const [Description, setDescription] = useState("") 선언하고 const [Private, setPrivate] = useState(0) const [Category, setCategory] = useState("Film & Animation") 이렇게 두개 선언해주고 option에 대해서 key value 이렇게 있을때 key value 두번 선언해서 해도 되지만 map을 이용해서 할 것입니다. 그걸 하.. 2021. 2. 25.
728x90
반응형