npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

hbbtv-lib

v0.0.3

Published

Library for common functionality needed in HbbTV applications.

Downloads

6

Readme

A library for HbbTV-application developers

hbbtv-lib is a collection of modules for common HbbTV functionality

  • Application manager to handle the requested keyset, show/hide and app launch
  • Companion screen manager
  • Sync manager wrapping the HbbTV MediaSynchroniser object

The individual modules are implemented in CommonJS style. This is same way as JavaScript modules are handled in Node.js runtime. Modules are intended to be used with webpack, which prepares the code for execution in HbbTV browser environments.

A version of hbbtv-lib that can be used without specific build tools is on the roadmap.

This project was originally developed as part of the 2-IMMERSE project, co-funded by the European Commission’s Horizon 2020 Research Programme

Install

Install via npm:

npm install --save hbbtv-lib

Usage

var AppMan = require('hbbtv-lib/main/appman');
var CSMan = require('hbbtv-lib/cs/cs_manager');
var SyncManager = require('hbbtv-lib/cs/sync_manager');
var UserAgentParser = require('hbbtv-lib/tools/useragent');

Use the application manager to set application visible and request keys from terminal.

AppMan.show();
AppMan.addKey(AppMan.COLOR);
AppMan.addKey(AppMan.NAVIGATION);

Discover launcher applications. The maximum timeout (1sec defined by the spec) can be increased for testing purposes.

CSMan.once(CSMan.CS_DISCOVERED, on_discovery_finished);
CSMan.discover_launchers(10000);

function on_discovery_finished (devices) {
	for (x in devices) {
		log(devices[x].friendly_name);
	}
}

Launch a webpage with the remote app2app service endpoint added to the URL.

CSMan.once(CSMan.CS_LAUNCH_RESPONSE, on_launch_response);
CSMan.launch_html(enum_id, url + "?a2a=" + CSMan.getA2A_remote() + app_endpoint);

function on_launch_response (enum_id, val) {
	log("Launch response from enum_id = " + enum_id + ": " + val);
}

Enable inter-device synchronisation with video/broadcast


mediaObj = document.getElementById("vbObject");
mediaObj.bindToCurrentChannel();

// wait for presenting state on mediaObj

syncMan = new SyncManager();

syncMan.on(SyncManager.EVT_MS_ERROR, on_ms_error);
syncMan.once(SyncManager.EVT_CII_ENABLED, on_cii_enabled);
syncMan.once(SyncManager.EVT_CII_DISABLED, on_cii_disabled);

syncMan.setMasterMedia(mediaObj, "urn:dvb:css:timeline:temi:1:1");
syncMan.enableCII();

function on_cii_enabled() {
    log("synchronisation with companion can be started.");
}

Build from source and run tests

NOTE: The following requires Grunt-CLI to be installed globally on your machine.

Build library from source:

grunt build

Run unit tests (this will build the libraries before running the unit tests):

grunt test

Build the documentation from JsDoc annotations in source code:

grunt doc

License and authors

All code and documentation is licensed by the original author and contributors under the Apache License v2.0:

See AUTHORS file for a full list of individuals and organisations that have contributed to this code.

Contributing

If you wish to contribute to this project, please get in touch with the authors.