Commit 90c38ec4 by Pragati Upadhyay

conTentType

parent 7ce04f32
...@@ -129,7 +129,7 @@ module.exports.generateVideo = async function (req, res) { ...@@ -129,7 +129,7 @@ module.exports.generateVideo = async function (req, res) {
let remotePath = path.join(CONFIG.S3_TUTOR_SHOT, fileName) let remotePath = path.join(CONFIG.S3_TUTOR_SHOT, fileName)
let remoteThumbnailPath = path.join(CONFIG.S3_TUTOR_SHOT, thumbnailName) let remoteThumbnailPath = path.join(CONFIG.S3_TUTOR_SHOT, thumbnailName)
let url = await uploadToAwsS3(videoPath, remotePath) let url = await uploadToAwsS3(videoPath, remotePath,{contentType:'video/mp4'})
await uploadToAwsS3(thumbnailPath, remoteThumbnailPath) await uploadToAwsS3(thumbnailPath, remoteThumbnailPath)
tutorShotData.thumbnailUrl = remoteThumbnailPath tutorShotData.thumbnailUrl = remoteThumbnailPath
tutorShotData.signedVideoUrl = await generatePreSignedGetUrl(remotePath) tutorShotData.signedVideoUrl = await generatePreSignedGetUrl(remotePath)
......
...@@ -83,7 +83,6 @@ module.exports.createVideo = async function (screenshots, outputPath) { ...@@ -83,7 +83,6 @@ module.exports.createVideo = async function (screenshots, outputPath) {
const clip = await createClipFromImageAsync(screenshot, duration, clipPath); const clip = await createClipFromImageAsync(screenshot, duration, clipPath);
clips.push(clip); clips.push(clip);
} }
console.log("🚀 ~ returnnewPromise ~ clips:", clips)
await concatenateClipsAsync(clips, outputPath); await concatenateClipsAsync(clips, outputPath);
resolve(); resolve();
......
...@@ -22,7 +22,8 @@ module.exports.uploadToAwsS3 = async function (localPath, remotePath, options) { ...@@ -22,7 +22,8 @@ module.exports.uploadToAwsS3 = async function (localPath, remotePath, options) {
var params = { var params = {
Body: buffer, Body: buffer,
Bucket: CONFIG.S3_BUCKET_NAME, Bucket: CONFIG.S3_BUCKET_NAME,
Key: remotePath Key: remotePath,
ContentType: options && options.contentType ? options.contentType : 'application/octet-stream'
}; };
s3.putObject(params, function (err, data) { s3.putObject(params, function (err, data) {
if (err) { if (err) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment