
Security News
vlt Launches "reproduce": A New Tool Challenging the Limits of Package Provenance
vlt's new "reproduce" tool verifies npm packages against their source code, outperforming traditional provenance adoption in the JavaScript ecosystem.
@byteark/video-upload-sdk
Advanced tools
Uploading video files directly from user's browser to ByteArk Stream and Qoder
Uploading video files directly from user's browser to ByteArk Stream and ByteArk Qoder service.
⚠️ For users who are using Video Upload SDK v1.2.3 and earlier, please refer the Migration Guide for migrating to v1.3.0 and newer. ⚠️
For Yarn:
yarn add @byteark/video-upload-sdk
For npm:
npm install --save @byteark/video-upload-sdk
import { VideoUploadManager } from '@byteark/video-upload-sdk';
async function main() {
// Initialize the SDK
const uploadManager = new VideoUploadManager({
// SDK Options
serviceName: 'byteark.stream' | 'byteark.qoder',
serviceEndpoint:
'https://stream.byteark.com' | 'https://qoder.byteark.com/apps/<appId>/ajax',
formId: '<formId(Stream)>' | '<appId(Qoder)>',
formSecret: '<formSecret>',
projectKey: '<projectKey(Stream)>' | '<projectId(Qoder)>',
// Callback Functions
onUploadProgress: (job: UploadJob, progress: UploadProgress) => {
// Called when video uploading has a progress.
},
onUploadCompleted: (job: UploadJob) => {
// Called when a video has uploaded.
},
onUploadFailed: (job: UploadJob, error: Error | DetailedError) => {
// Called when video uploading failed (cannot retry).
},
onVideosCreated: (videoKeys: string[]) => {
// Called after all videos are created on our service.
},
});
// An example use case
uploadManager.addUploadJobs(fileList);
await uploadManager.start();
}
main();
You are required to create a form upload to use this SDK. You will obtain formId
and formSecret
after creating the form.
byteark.stream
https://stream.byteark.com
formId
formSecret
projectKey
that you want to upload videos into. Please refer to this documentation to get your project key.ByteArk Qoder is our legacy service. Please contact ByteArk admin for Qoder's appId
and appSecret
.
byteark.qoder
https://qoder.byteark.com/apps/<appId>/ajax
appId
appSecret
Name | Returns | Description |
---|---|---|
getJobQueue | UploadJob[] | Returns a job queue array. |
getJobByUploadId | UploadJob | undefined | Returns a job that matches the provided uploadId. |
getIsUploadStarted | boolean | Returns true if any upload job has started. |
getIsAllUploadCancelled | boolean | Returns true if all jobs in a queue have been cancelled. |
Promise<void>
Add videos that you want to upload. The SDK will create videos from the inputted files, trigger "onVideosCreated" callback, and add them to a job queue.
files
can be FileList
, File[]
, or VideoFileObject[]
type.
File
or FileList
to upload videos. Your video titles will be a name of the uploaded file.VideoFileObject
if you want to specify more details to your video. VideoFileObject
is an object containing the following fields:
file
: Your video file.videoMetadata
: An object containing any pair of string value, with no required fields. Example object fields are:
title
A title of your video.tags
Tags of your video.void
Set a new options to VideoUploadManager. This operation cannot be done when any upload job has already started.
Promise<void>
Start uploading from a job queue.
Promise<UploadJob>
Pause a job by the provided uploadId.
This method throws an error when a job with the provided uploadId cannot be found.
Promise<UploadJob>
Resume a job by the provided uploadId.
This method throws an error when a job with the provided uploadId cannot be found.
Promise<UploadJob>
Cancel a job by the provided uploadId.
This method throws an error when a job with the provided uploadId cannot be found.
Promise<void>
Cancel all jobs in a job queue.
Triggers after all videos are created on our service, which will happen after calling addUploadJobs(files)
method.
Triggers after the first upload job started uploading.
Triggers periodically when upload job(s) are being uploaded.
Triggers after all upload jobs finished uploading.
Triggers when something happened while uploading and halted the uploader.
We have an example application in
This guide details the changes and how to change your code to migrate to Video Upload SDK version 1.3.
To upload videos to ByteArk Stream, you are now required to create a form upload. You will obtain formId and formSecret after creating the form. And you are now required to initialize the SDK using these form ID and form secret. Click here for an example code.
authorizationToken was removed from the SDK options. Please remove it from either ByteArk Qoder or ByteArk Stream service.
addUploadJob method was removed. Please use addUploadJobs instead. You can now add multiple videos using this new method.
The SDK will now create videos when adding upload jobs. After videos are created, the SDK will also trigger onVideosCreated callback.
FAQs
Uploading video files directly from user's browser to ByteArk Stream and Qoder
The npm package @byteark/video-upload-sdk receives a total of 171 weekly downloads. As such, @byteark/video-upload-sdk popularity was classified as not popular.
We found that @byteark/video-upload-sdk demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 6 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
vlt's new "reproduce" tool verifies npm packages against their source code, outperforming traditional provenance adoption in the JavaScript ecosystem.
Research
Security News
Socket researchers uncovered a malicious PyPI package exploiting Deezer’s API to enable coordinated music piracy through API abuse and C2 server control.
Research
The Socket Research Team discovered a malicious npm package, '@ton-wallet/create', stealing cryptocurrency wallet keys from developers and users in the TON ecosystem.