Simple
node.js
demoÂ
Node doesn't support
client
only server
processing typeÂ
import * as fs from 'fs'
import Modfy from '@modfy/core'
const modfy = new Modfy({
token : '',
secretToken : '',
clientSide : false // Remember node doesn't support client
})
const main = async () => {
const video = await modfy.compress(['input.mp4'], 'server', 30)
console.log('Processed!')
fs.writeFileSync('output.mp4', video)
}
main()
Â
Â
ES5
const fs = require('fs')
const Modfy = require('@modfy/core')
const modfy = new Modfy.default({
token : '',
secretToken : '',
clientSide : false // Remember node doesn't support client
})
const main = async () => {
const video = await modfy.compress(['input.mp4'], 'server', 30)
console.log('Processed!')
fs.writeFileSync('output.mp4', video)
}
main()
Â