Security News
Fluent Assertions Faces Backlash After Abandoning Open Source Licensing
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
Using npm:
$ npm install m3dia
Performing a GET TOKEN
request
var m3dia = require('m3dia');
var m3 = new m3dia({
server: 'https://m3dia.gostream.co',
user: {
username: 'username',
password: '123456'
}
});
(async () => {
try {
var token = await m3.getToken();
console.log(token);
} catch (e) {
// Deal with the fact the chain failed
}
})();
Performing a SET TOKEN
request
If you have a long time token, instead get token via username and password, you can set it to use.
var m3dia = require('m3dia');
var m3 = new m3dia({
server: 'https://m3dia.gostream.co',
token: 'your-long-time-token',
});
(async () => {
try {
var data = new FormData();
data.append('media', fs.createReadStream('/path/to/your/file/filename.mov'));
data.append('is_convert', 'false');// if you don't need convert to mp4 faststart
var file = await m3.upload(data);
console.log("Files: ", file);
} catch (e) {
// Deal with the fact the chain failed
}
})();
Performing a UPLOAD
request
var FormData = require('form-data');
var fs = require('fs');
var m3dia = require('m3dia');
var m3 = new m3dia({
server: 'https://m3dia.gostream.co',
user: {
username: 'username',
password: '123456'
}
});
(async () => {
try {
await m3.getToken();
var data = new FormData();
data.append('media', fs.createReadStream('/path/to/your/file/filename.mov'));
data.append('is_convert', 'false');// if you don't need convert to mp4 faststart
// if you need use transcode maximum size (support: 360, 480, 720, 1080 )
// data.append('is_convert', 'true')
// data.append('maximum_resolution', 720)
var file = await m3.upload(data);
console.log("Files: ", file);
} catch (e) {
// Deal with the fact the chain failed
}
})();
Performing a CHUNKING UPLOAD
request
var m3 = new m3dia({
server: 'https://m3dia.gostream.co',
user: {
username: 'username',
password: '123456'
},
maxActiveChunk: 5, //default 3
});
(async () => {
try {
await m3.getToken();
var file = await m3.chunkUpload('/path/to/your/file/filename.mov');
//or if you don't need convert to mp4 faststart
// var file = await m3.chunkUpload('/path/to/your/file/filename.mov', 'false');
// if you need use transcode to 480p
// var file = await m3.chunkUpload('/path/to/your/file/filename.mov', {isConvert: 'true', isTranscode:'true'});
// if you need use transcode maximum size (support: 360, 480, 720, 1080 )
// var file = await m3.chunkUpload('/path/to/your/file/filename.mov', {isConvert: 'true', isTranscode:'true', maximumResolution:1080});
console.log("\nFiles: ", file);
} catch (e) {
// Deal with the fact the chain failed
}
})();
Performing a GET FILE STATUS
request
(async () => {
try {
var stt = await m3.getFileStatus([String]fileId)
console.log("Status: ", stt);
} catch (e) {
// Deal with the fact the chain failed
}
})();
Performing a GET URI
request
(async () => {
try {
console.log("Files: ", m3.getUri([String]enpoit));
} catch (e) {
// Deal with the fact the chain failed
}
})();
Performing a DELETE FILE
request
(async () => {
try {
var del = await m3.deleteFile([String]fileId)
console.log("Delete: ", del.data);
} catch (e) {
// Deal with the fact the chain failed
}
})();
Performing a GET M3DIA LINK FROM YOUTUBE VIDEO ID
request
(async () => {
try {
var file = await m3.youtubeDownload('your-youtube-id');
console.log("File: ", file);
} catch (e) {
// Deal with the fact the chain failed
}
})();
Performing a GET M3DIA LINK FROM FACEBOOK VIDEO URL
request
(async () => {
try {
var file = await m3.facebookDownload('your-facebook-video-url');
console.log("File: ", file);
} catch (e) {
// Deal with the fact the chain failed
}
})();
FAQs
Gostream m3dia cdn SDK
The npm package m3dia receives a total of 0 weekly downloads. As such, m3dia popularity was classified as not popular.
We found that m3dia demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
Research
Security News
Socket researchers uncover the risks of a malicious Python package targeting Discord developers.
Security News
The UK is proposing a bold ban on ransomware payments by public entities to disrupt cybercrime, protect critical services, and lead global cybersecurity efforts.