{"id":32999730,"url":"https://github.com/cloudinary/cloudinary-js-streaming","last_synced_at":"2025-12-25T01:48:23.346Z","repository":{"id":36944208,"uuid":"160165486","full_name":"cloudinary/cloudinary-js-streaming","owner":"cloudinary","description":"Cloudinary Live Streaming Javascript SDK","archived":false,"fork":false,"pushed_at":"2023-06-23T22:03:59.000Z","size":163,"stargazers_count":6,"open_issues_count":0,"forks_count":5,"subscribers_count":31,"default_branch":"master","last_synced_at":"2024-08-09T08:50:55.659Z","etag":null,"topics":["cloudinary-sdk"],"latest_commit_sha":null,"homepage":"https://cloudinary.com/","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/cloudinary.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2018-12-03T09:28:00.000Z","updated_at":"2021-11-03T11:38:15.000Z","dependencies_parsed_at":"2024-01-16T12:50:04.466Z","dependency_job_id":"491cb947-b1a2-48cf-a9e7-e7e5488cea37","html_url":"https://github.com/cloudinary/cloudinary-js-streaming","commit_stats":{"total_commits":41,"total_committers":6,"mean_commits":6.833333333333333,"dds":"0.46341463414634143","last_synced_commit":"51231db2583d57cf32076847adf6d83b81c8661d"},"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"purl":"pkg:github/cloudinary/cloudinary-js-streaming","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cloudinary%2Fcloudinary-js-streaming","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cloudinary%2Fcloudinary-js-streaming/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cloudinary%2Fcloudinary-js-streaming/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cloudinary%2Fcloudinary-js-streaming/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cloudinary","download_url":"https://codeload.github.com/cloudinary/cloudinary-js-streaming/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cloudinary%2Fcloudinary-js-streaming/sbom","scorecard":{"id":292994,"data":{"date":"2025-08-11","repo":{"name":"github.com/cloudinary/cloudinary-js-streaming","commit":"51231db2583d57cf32076847adf6d83b81c8661d"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3.3,"checks":[{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Code-Review","score":2,"reason":"Found 6/30 approved changesets -- score normalized to 2","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: MIT License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 10 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}}]},"last_synced_at":"2025-08-17T18:46:03.982Z","repository_id":36944208,"created_at":"2025-08-17T18:46:03.982Z","updated_at":"2025-08-17T18:46:03.982Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":285879574,"owners_count":27247109,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-11-22T02:00:05.934Z","response_time":64,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cloudinary-sdk"],"created_at":"2025-11-13T13:00:27.152Z","updated_at":"2025-11-23T00:02:22.230Z","avatar_url":"https://github.com/cloudinary.png","language":"JavaScript","readme":"Cloudinary\n==========\n\nCloudinary is a cloud service that offers a solution to a web application's entire image and video management pipeline.\nEasily upload images and videos to the cloud. Automatically perform smart resizing, cropping and conversion \nwithout installing any complex software. \nCloudinary offers comprehensive APIs and administration capabilities and is easy to integrate with any web application,\nexisting or new.\n\nVideo live-stream \n=================\n\nCloudinary provides an end-to-end live video streaming solution, with on the fly video effects and transformations.\nWhen using the library in your website this is what happens:\n1. Video is streamed from the device's camera.\n2. The video is up-streamed through Cloudinary, providing the streaming user with a Cloudinary public id and resource\n url of the stream.\n3. The stream is now publicly available through that url, and can be fed into any streaming-supported video player.\n4. If any transformations and effects were added to the stream (during configuration, see below) all the viewers will\nsee the modified stream.\n## Setup ######################################################################\n\n1. Sign up for a [free account](https://cloudinary.com/users/register/free).\n\n2. Create an upload preset [here](https://cloudinary.com/console/upload_presets/new), and enable \nthe ****live-streaming**** setting. This is also the place to add any wanted effects and transformations under the \n'Incoming transformations' section.\n\n3. fetch the library from npm:\n\n    ```npm install @cloudinary/js-streaming```\n\n## Usage ######################################################################\n\n### Streaming #################################################################\nAfter completing the setup, import the library and initialize it. There are two required parameters:\n* cloudName - this is the cloud name assigned to you when creating the Cloudinary free account.\n* uploadPreset - This is the name of the upload preset created in step two of the setup.\n\nThere are several optional parameters:\n* `stream`: The [MediaStream](https://developer.mozilla.org/en-US/docs/Web/API/MediaStream) to use as the streaming source. Required only if you obtain a MediaStream object yourself with a `getUserMedia` request or the `getStream` helper function, rather than have the library get a stream from the default device by itself. \n* `debug`: Log level (disabled by default), one of, or array of ```['trace', 'debug', 'vdebug', 'log', 'warn', 'error']```. pass in ```'all'``` to print all\n messages.\n* `bandwidth`: Bandwith, in bits. Default is 1Mbit/s (1024 * 1024).\n* `hlsTarget`: `[true/false]`, When true, will stream live using hls protocol.\n* `fileTarget`: `[true/false]`, When true, will save an mp4 file in your Cloudinary media library.\n* `facebookUri`: A Facebook streaming URI used to direct the stream to facebook. \nSupplied by facebook when configuring Facebook streaming.\n* `youtubeUri`: A Youtube streaming URI used to direct the stream to Youtube. Supplied by youtube when configuring\n Youtube streaming.\n* `events`: callback for events, supporting the following functions:\n    * `start`: Called when the streaming starts. Includes the recording Id. \n    * `stop`: Called when the streaming stops. Includes the recording Id.\n    * `error`: Called when the library encounters an error. The error message is included in the callback.\n    * `local_stream`: Called when the stream is available locally (stream is provided in the callback). This can be used \n    to display to the user his own streaming as it up-streams.\n    \n```javascript\nimport {initLiveStream} from '@cloudinary/js-streaming'\n\n// ...\n\n// configure your cloud name and the live-stream enabled upload-preset:\nconst cloudName = [your-cloud-name];\nconst uploadPreset = [your-upload-preset];\nlet liveStreamLibrary;\n\n// ...\n\n// call initLiveStream with the configuration parameters:\ninitLiveStream({\n cloudName: cloudName,\n uploadPreset: uploadPreset,\n debug: \"all\",\n hlsTarget: true,\n fileTarget: true,\n events: {\n   start: function (args) {\n     // user code\n   },\n   stop: function (args) {\n     // user code\n   },\n   error: function(error){\n     // user code\n   },\n   local_stream: function (stream) {\n     // user code, typically attaching the stream to a video view:\n     liveStreamLibrary.attach($(\"#thevideo\").get(0), stream);\n   }\n }\n}).then((result) =\u003e {\n  // keep handle to instance to start/stop streaming \n  liveStreamLibrary = result;\n  \n  // Extract public id and url from result (publish the url for people to watch the stream):\n  let publicId = result.response.public_id;\n  let url = result.response.secure_url;\n  \n  // start the streaming:\n  liveStreamLibrary.start(publicId);\n})\n```\n\n#### Select device to stream from ################################################################\n```javascript\nimport {getStream, initLiveStream, FRONT_CAMERA, REAR_CAMERA} from '@cloudinary/js-streaming';\n\n// Get front camera stream\ngetStream(FRONT_CAMERA).then((stream)=\u003e{})\n\n// Get rear camera stream\ngetStream(REAR_CAMERA).then((stream)=\u003e{})\n\n// Get custom device stream\ngetStream({audio: true, video: { facingMode: \"user\" } }).then((stream)=\u003e{})\n\n// Select device to stream from by passing the stream to initLiveStream()\ngetStream(FRONT_CAMERA).then((stream)=\u003e {\n  initLiveStream({cloudName, uploadPreset, stream, ...});\n});\n```\n\n### Streaming Devices ####################################################\nThe live streaming sdk contains some convenient helper functions and constants:\n* listDevices - get list of streaming devices.\n* getStream - get stream from device.\n* FRONT_CAMERA - pass this to getStream() in order to get stream from the front camera.\n* REAR_CAMERA - pass this to getStream() in order to get stream from the rear camera.\n\n### Camera Control ###############################################################\nThe live streaming sdk contains some convenient camera functions:\n* attachCamera: Show camera in an html \u003cvideo\u003e element.\n* detachCamera - Remove camera from an html \u003cvideo\u003e element.\n* Streamer - a convenient wrapper for camera and streaming functions,\nit exposes functions for showing, hiding and streaming from a camera.\n\n#### attachCamera \u0026 detachCamera ################################################################\n```javascript\nimport {attachCamera, detachCamera} from '@cloudinary/js-streaming';\nconst video = document.getElementById(\"video\");\nconst facingMode =  { exact: \"user\" };\n\n// Show camera in an html \u003cvideo\u003e element\n// facingMode is optional\nattachCamera(video, facingMode).then(stream=\u003econsole.log(stream));\n\n// Remove camera from an html \u003cvideo\u003e element\ndetachCamera(video).then(videoElement=\u003econsole.log(videoElement));\n```\n\n#### Streamer ################################################################\n```javascript\nimport {Streamer} from '@cloudinary/js-streaming';\nconst video = document.getElementById(\"video\");\nconst facingMode =  { exact: \"user\" };\nconst liveStreamOptions = {};\nconst streamer = new Streamer(video);\n\n// Show camera in an html \u003cvideo\u003e element\n// facingMode is optional\nstreamer.attachCamera(facingMode).then(stream=\u003econsole.log(stream));\n\n// Remove camera from an html \u003cvideo\u003e element\nstreamer.detachCamera().then(videoElement=\u003econsole.log(videoElement));\n\n// Initialize live-streaming using streaming configuration object\nstreamer.initLiveStream(liveStreamOptions).then(result =\u003e console.log(result));\n```\n\n## Additional resources ##########################################################\n\nAdditional resources are available at:\n\n* [Website](https://cloudinary.com)\n* [Interactive demo](https://demo.cloudinary.com/live)\n* [Documentation](https://cloudinary.com/documentation)\n* [Knowledge Base](https://support.cloudinary.com/hc/en-us)\n* [Video transformations documentation](https://cloudinary.com/documentation/video_manipulation_and_delivery)\n\n## Support\n\nYou can [open an issue through GitHub](https://github.com/cloudinary/cloudinary-js-streaming/issues).\n\nContact us [https://cloudinary.com/contact](https://cloudinary.com/contact)\n\nStay tuned for updates, tips and tutorials: [Blog](https://cloudinary.com/blog), [Twitter](https://twitter.com/cloudinary), [Facebook](https://www.facebook.com/Cloudinary).\n\n## Join the Community ##########################################################\n\nImpact the product, hear updates, test drive new features and more! Join [here](https://www.facebook.com/groups/CloudinaryCommunity).\n\n\n## License #######################################################################\n\nReleased under the MIT license.\n","funding_links":[],"categories":["Tools"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcloudinary%2Fcloudinary-js-streaming","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcloudinary%2Fcloudinary-js-streaming","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcloudinary%2Fcloudinary-js-streaming/lists"}