Git Product home page Git Product logo

Comments (4)

darron1217 avatar darron1217 commented on July 20, 2024

I'm currently using Strapi v3.4.4 and it works well on my version.
Anyway, did you run yarn build or npm run build after installation?

from strapi-plugin-video-thumbnail.

kgnfth avatar kgnfth commented on July 20, 2024

yes i can see it now in the menu but how does the plugin work
does it generate thumbnail after you upload video

from strapi-plugin-video-thumbnail.

darron1217 avatar darron1217 commented on July 20, 2024

This plugin uses beforeCreate database lifecycle hook to trigger thumbnail generation.

const ffmpeg = require('fluent-ffmpeg');
module.exports = () => {
// inject lifecycle hook
// TODO : Find better way to trigger thumbnail generation
const {beforeCreate, ...lifecycles} = strapi.plugins.upload.models.file.lifecycles || {}
const {generateThumbnail} = strapi.plugins['video-thumbnail'].services[
'video-thumbnail'
];
strapi.plugins.upload.models.file.lifecycles = {
...lifecycles,
async beforeCreate(data) {
// run original method (if exists)
if(beforeCreate) {
beforeCreate(data);
}
// Run if file type is video
if(data.mime.startsWith('video')) {
await generateThumbnail(data);
}
},
};
};

from strapi-plugin-video-thumbnail.

darron1217 avatar darron1217 commented on July 20, 2024

Anyway this issue seems solved.
If you have another issue, feel free to create one :)

from strapi-plugin-video-thumbnail.

Related Issues (3)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.