{"id":14035911,"url":"https://github.com/opentok/accelerator-screen-sharing-js","last_synced_at":"2025-07-27T03:31:01.662Z","repository":{"id":47445276,"uuid":"81824266","full_name":"opentok/accelerator-screen-sharing-js","owner":"opentok","description":"Accelerator Screen Sharing JS provides an easy way to get started in implementing interoperable screen sharing using the OpenTok platform.","archived":true,"fork":false,"pushed_at":"2021-09-01T15:36:30.000Z","size":203,"stargazers_count":16,"open_issues_count":5,"forks_count":16,"subscribers_count":27,"default_branch":"main","last_synced_at":"2024-10-30T04:51:05.320Z","etag":null,"topics":["javascript","opentok","screensharing","tokbox","webrtc"],"latest_commit_sha":null,"homepage":"https://tokbox.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/opentok.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-02-13T12:45:47.000Z","updated_at":"2023-01-20T14:14:10.000Z","dependencies_parsed_at":"2022-08-17T14:46:02.212Z","dependency_job_id":null,"html_url":"https://github.com/opentok/accelerator-screen-sharing-js","commit_stats":null,"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/opentok%2Faccelerator-screen-sharing-js","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/opentok%2Faccelerator-screen-sharing-js/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/opentok%2Faccelerator-screen-sharing-js/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/opentok%2Faccelerator-screen-sharing-js/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/opentok","download_url":"https://codeload.github.com/opentok/accelerator-screen-sharing-js/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":227533049,"owners_count":17784293,"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","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":["javascript","opentok","screensharing","tokbox","webrtc"],"created_at":"2024-08-12T03:01:45.918Z","updated_at":"2024-12-02T15:31:07.857Z","avatar_url":"https://github.com/opentok.png","language":"JavaScript","funding_links":[],"categories":["JavaScript"],"sub_categories":[],"readme":"# Accelerator Screensharing for Javascript\n\n[![Build Status](https://app.travis-ci.com/opentok/accelerator-screen-sharing-js.svg?branch=main)](https://app.travis-ci.com/github/opentok/accelerator-screen-sharing-js)\n[![GitHub release](https://img.shields.io/github/release/opentok/accelerator-screen-sharing-js.svg)](./README.md)\n[![license MIT](https://img.shields.io/github/license/mashape/apistatus.svg)](./.github/LICENSE)\n[![npm](https://img.shields.io/npm/v/opentok-screen-sharing.svg)](https://www.npmjs.com/package/opentok-screen-sharing)\n\n\u003cimg src=\"https://assets.tokbox.com/img/vonage/Vonage_VideoAPI_black.svg\" height=\"48px\" alt=\"Tokbox is now known as Vonage\" /\u003e\n\n## Quick start\n\nThe OpenTok Screensharing Accelerator Pack provides functionality you can add to your OpenTok applications that enables users to share the screen. This section shows you how to use the accelerator pack.\n\n## Install\n\n```bash\n$ npm install --save opentok-screen-sharing\n```\n\nIf using browserify or webpack:\n\n```javascript\nconst screenSharing = require('opentok-screen-sharing');\n```\n\nOtherwise, include the accelerator pack in your html:\n\n```html\n\u003cscript src=\"../your/path/to/opentok-screen-sharing.js\"\u003e\u003c/script\u003e\n```\n\n . . . and it will be available in global scope as `ScreenSharingAccPack`\n\n-----------------\n\nClick [here](https://www.npmjs.com/search?q=opentok-acc-pack) for a list of all OpenTok accelerator packs.\n\n## Exploring the code\n\nThe `ScreenShareAccPack` class in opentok-screen-sharing.js is the backbone of the screen share feature for the app.\nThis class sets up the screen share UI views and events, and provides functions for sending, receiving, and rendering shared screens.\n\n### Initialization\n\nThe following `options` fields are used in the `ScreenShareAccPack` constructor:\u003cbr/\u003e\n\n | Feature                                                                               | Field                    | Required |\n | ------------------------------------------------------------------------------------- | ------------------------ | -------- |\n | Set the OpenTok session  (object).                                                    | `session`                | `true`   |\n | Set the screen container (string).                                                    | `screenSharingContainer` | `false`  |\n | Set the Common layer API (object).                                                    | `accPack`                | `false`  |\n | Set the ID of the Chrome extension (string).                                          | `extensionID`            | `false`  |\n | Append a link tag for Chrome Web Store inline install (boolean) (defaults to `true`). | `appendWebStoreLink`     | `false`  |\n | Set the download path for the FireFox extension (string).                             | `extentionPathFF`        | `false`  |\n | Using screen sharing with the annotation accelerator pack.                            | `annotation`             | `false`  |\n | If using annotation, should we use an external window.                                | `externalWindow`         | `false`  |\n | Set the container to append the start/stop button (string).                           | `controlsContainer`      | `false`  |\n | Append the start/stop button to the DOM                                               | `appendControl`          | `false`  |\n | Set custom properties for the publisher (object)                                      | `localScreenProperties`  | `false`  |\n | Allow screen sharing over `http` in development (boolean)                             | `dev`                    | `false`  |\n\nOnce you define the options, you simply create a new instance of the  `ScreenShareAccPack`:\n\n```javascript\n      const screenShareOptions = {\n       session: session,\n       extensionID: myChromeExtensionID,\n       extentionPathFF: myFirefoxExentionPath,\n       screensharingParent: myParentContainer,\n     };\n     const screenSharing = new ScreenShareAccPack(screenShareOptions);\n```\n\n#### ScreenShareAccPack Methods\n\nThe `ScreenShareAccPack` component has the following methods:\n\n| Method                 | Description                             |\n| ---------------------- | --------------------------------------- |\n| `extensionAvailable()` | Test whether an extension is available. |\n| `start()`              | Start sharing screen.                   |\n| `end()`                | Stop sharing screen.                    |\n\n#### Events\n\nThe `ScreenSharingAccPack` component emits the following events:\n\n | Event                 | Description                                  |\n | --------------------- | -------------------------------------------- |\n | `startScreenSharing ` | We've started publishing/sharing the screen. |\n | `endScreenSharing `   | We've stopped publishing/sharing the screen. |\n | `screenSharingError ` | A screen sharing error occurred.             |\n\nIf using the screen sharing accelerator pack with [Accelerator Core](https://github.com/opentok/accelerator-core-js), you can subscribe to these events by calling `on` on  `otCore` and providing a callback function:\n\n```javascript\notCore.on('eventName', callback)\n```\n\n### Multiparty video communication sample app using the Accelerator Screensharing with best-practices for Javascript (https://github.com/opentok/accelerator-sample-apps-js)\n\n## Development and Contributing\n\nInterested in contributing? We :heart: pull requests! See the [Contribution](CONTRIBUTING.md) guidelines.\n\n## Getting Help\n\nWe love to hear from you so if you have questions, comments or find a bug in the project, let us know! You can either:\n\n- Open an issue on this repository\n- See \u003chttps://support.tokbox.com/\u003e for support options\n- Tweet at us! We're [@VonageDev](https://twitter.com/VonageDev) on Twitter\n- Or [join the Vonage Developer Community Slack](https://developer.nexmo.com/community/slack)\n\n## Further Reading\n\n- Check out the Developer Documentation at \u003chttps://tokbox.com/developer/\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fopentok%2Faccelerator-screen-sharing-js","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fopentok%2Faccelerator-screen-sharing-js","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fopentok%2Faccelerator-screen-sharing-js/lists"}