{"id":18376830,"url":"https://github.com/bbc/dvbcss-protocols","last_synced_at":"2025-10-23T22:16:19.085Z","repository":{"id":49564740,"uuid":"106676658","full_name":"bbc/dvbcss-protocols","owner":"bbc","description":"Javascript library implementing DVB CSS protocols for companion synchronisation. Compatible with node and browser.","archived":false,"fork":false,"pushed_at":"2024-11-27T15:13:15.000Z","size":183,"stargazers_count":4,"open_issues_count":3,"forks_count":1,"subscribers_count":7,"default_branch":"master","last_synced_at":"2025-07-05T02:24:08.209Z","etag":null,"topics":["dvb-css","dvb-protocols","dvbcss","hbbtv2","javascript","media-synchronisation","nodejs","rd-project","rd-section-bcs","rd-stability-green","synchronisation","wall-clock"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/bbc.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":"AUTHORS","dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-10-12T10:06:57.000Z","updated_at":"2025-06-06T10:57:26.000Z","dependencies_parsed_at":"2024-12-10T20:47:22.444Z","dependency_job_id":null,"html_url":"https://github.com/bbc/dvbcss-protocols","commit_stats":{"total_commits":74,"total_committers":8,"mean_commits":9.25,"dds":0.5,"last_synced_commit":"9e04e945908102fff3c769ba238dcba5fe00c55a"},"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/bbc/dvbcss-protocols","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bbc%2Fdvbcss-protocols","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bbc%2Fdvbcss-protocols/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bbc%2Fdvbcss-protocols/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bbc%2Fdvbcss-protocols/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bbc","download_url":"https://codeload.github.com/bbc/dvbcss-protocols/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bbc%2Fdvbcss-protocols/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":266856980,"owners_count":23995778,"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-07-24T02:00:09.469Z","response_time":99,"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":["dvb-css","dvb-protocols","dvbcss","hbbtv2","javascript","media-synchronisation","nodejs","rd-project","rd-section-bcs","rd-stability-green","synchronisation","wall-clock"],"created_at":"2024-11-06T00:24:55.083Z","updated_at":"2025-10-23T22:16:14.040Z","avatar_url":"https://github.com/bbc.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# JS sync protocols library for companion synchronisation\n\n[![npm\nversion](https://badge.fury.io/js/dvbcss-protocols.svg)](https://badge.fury.io/js/dvbcss-protocols)\n[![Build status](https://travis-ci.org/bbc/dvbcss-protocols.svg?branch=master)](https://travis-ci.org/bbc/dvbcss-protocols)\n[![API Doc](https://doclets.io/bbc/dvbcss-protocols/master.svg)](https://doclets.io/bbc/dvbcss-protocols/master)\n\ndvbcss-protocols is a javascript library implementing client and server protocols\nfor synchronisation between TVs and companion screen applications using the protocols\nspecified by [DVB CSS](http://www.etsi.org/standards-search?search=103+286\u0026page=1\u0026title=1\u0026keywords=1\u0026ed=1\u0026sortby=1)\nor [HbbTV 2](http://hbbtv.org/resource-library/). \n \nThe library is written in ES5 and works in the browser where it can provide WebSocket based clients only. To use it in applications that will run it the browser, it must be pre-processed using [webpack](https://webpack.js.org/) or [browserify](http://browserify.org/). It also works in\nnode.js where it provides both UDP and WebSocket clients+servers.\n\n|**Feature**             |**Supported in node**|**Supported in browser**\u003cbr/\u003e(webpack/browserify) |\n|------------------------|:------:|:-----------------------------------:|\n|CII client (WebSockets) |  YES   | YES                                 |\n|TS client (WebSockets)  |  YES   | YES                                 |\n|TS client (UDP)         |  YES   |                                     |\n|WC client (UDP)         |  YES   |                                     |\n|WC client (WebSockets)  |  YES   | YES                                 |\n|WC server (UDP)         |  YES   |                                     |\n|WC server (WebSockets)  |  YES   | \u0026nbsp;                              |\n\nThis library has similarities to the protocol components in [pydvbcss](https://github.com/bbc/pydvbcss)\nand uses some similar patterns.\n\n\u003cimg src=\"https://2immerse.eu/wp-content/uploads/2016/04/2-IMM_150x50.png\" align=\"left\"/\u003e\u003cem\u003eThis project was originally developed as part of the \u003ca href=\"https://2immerse.eu/\"\u003e2-IMMERSE\u003c/a\u003e project, co-funded by the European Commission’s \u003ca hef=\"http://ec.europa.eu/programmes/horizon2020/\"\u003eHorizon 2020\u003c/a\u003e Research Programme\u003c/em\u003e\n\n## Getting started\n\n### Use in your own project\n\n\nInstall via npm:\n\n    $ npm install --save dvbcss-protocols\n    \nOr download or clone this repository and build:\n\n    $ cd dvbcss-protocols\n    $ npm install\n    \n### Browser or node?\n\nIf you build your browser application using [webpack](https://webpack.js.org/) or [browserify](http://browserify.org/) then a different entry point will be used\nthat excludes the features not supported within in the browser.\n\nIf you use a different build process then you may need to select the entry\npoint manually:\n\n * `main_node.js` is for node.js and is listed as \"main\" in `package.json`.\n * `main_browser.js` is for browsers and is listed as \"browser\" in `package.json`.\n\n### Run the examples\n\nThere are simple examples of clients and servers in the `/examples` sub-directory.\nUse the `--help` option to determine the command line options for each example.\n\n## Documentation\n\nJSDoc documentation can be built:\n\n    $ grunt doc\n\nDocumentation is generated and output as HTML into the `doc` subfolder.\n\n\n## Unit tests\n\nUnit tests are written using the jasmine unit test framework.\n\n    $ grunt test\n\n\n## Simple example\n\nCreating a wall clock client using JSON format messages via a WebSocket\nconnection:\n\n    var WebSocket = require('ws');\n\n    var clocks = require(\"dvbcss-clocks\");\n    var Protocols = require(\"dvbcss-protocols\");\n    var WallClock = Protocols.WallClock;\n    var createClient = WallClock.createJsonWebSocketClient;\n\n    var ws = new WebSocket(\"ws://127.0.0.1:7681/wall-clock-server\");\n\n    var root = new clocks.DateNowClock();\n    var wallClock = new clocks.CorrelatedClock(root);\n\n    var client = createClient(ws, wallClock);\n\nThen at some point later, just close the WebSocket connection to stop the client:\n\n    ws.close();\n\nThere are also functions to create other variants using different serialisations\nor network connection types; and also for other protocols (CII protocol, TS protocol)...\n\n## Factory functions provided\n\n    var Protocols = require(\"dvbcss-protocols\");\n    \n    var CII = Protocols.CII;\n    var TimelineSynchronisation = Protocols.TimelineSynchronisation;\n    var WallClock = Protocols.WallClock;\n\n\n**CII protocol** (clients only)\n\n* `CII.`**`createCIIClient`** (JSON, WebSockets)\n\n\n**Timeline Synchronisation protocol** (clients only)\n\n* `TimelineSynchronisation.`**`createTSClient`** (JSON, WebSockets)\n\n\n**Wall Clock protocol** (clients and servers)\n\n* `WallClock.`**`createJsonWebSocketClient`**\n* `WallClock.`**`createBinaryWebSocketClient`**\n* `WallClock.`**`createBinaryUdpClient`**\n* `WallClock.`**`createBinaryWebSocketServer`**\n* `WallClock.`**`createBinaryUdpServer`**\n\nNote that only Binary messages via UDP are truly compliant with the DVB-CSS\nspecification. The other variants have been created for convenience for use\nin other applications that do not communicate directly with a TV implementing\nDVB-CSS.\n\n## Super-quick introduction to the protocols\n\nDVB has defined 3 protocols for communicating between a companion and TV in\norder to create synchronised second screen / dual screen / companion experiences\n(choose whatever term you prefer!) that are implemented here:\n\n * CSS-CII - A WebSockets+JSON protocol that conveys state from the TV, such as\n   the ID of the content being shown at the time. It also carries the URLs to\n   connect to the other two protocols.\n\n * CSS-WC - A simple UDP protocol (like NTP but simplified) that establishes a\n   common shared clock (a \"wall clock\") between the TV and companion, compensating\n   for network delays.\n\n * CSS-TS - Another WebSockets+JSON protocol that communicates timestamps from\n   TV to Companion that describe the current timeline position.\n\nThe TV implements servers for all 3 protocols. The Companion implements clients.\n\nThere are other protocols defined in the specification (CSS-TE and CSS-MRS) that\nare not currently implemented by this library.\n\n\n## Licence and Authors\n\nAll code and documentation is licensed by the original author and contributors under the Apache License v2.0:\n\n* [British Broadcasting Corporation](http://www.bbc.co.uk/rd) (original author)\n* [Institut für Rundfunktechnik](http://www.irt.de/)\n* [British Telecommunications (BT) PLC](http://www.bt.com/)\n\nSee AUTHORS file for a full list of individuals and organisations that have\ncontributed to this code.\n.\n\n## Contributing\n\nIf you wish to contribute to this project, please get in touch with the authors.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbbc%2Fdvbcss-protocols","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbbc%2Fdvbcss-protocols","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbbc%2Fdvbcss-protocols/lists"}