1.0.3 • Published 5 years ago

b24.js v1.0.3

Weekly downloads
24
License
MIT
Repository
github
Last release
5 years ago

b24.js npm

An HTML5 subtitle renderer for ARIB STD-B24 data packet, which is transmitted over the Digital TV Broadcasting in Japan.

Features

  • Converting to WebVTT
  • Keeping original multiple caption lines
  • Colored rendering with font color specified by data packet

Build

Preparing

git clone https://github.com/xqq/b24.js.git
cd b24.js
git submodule update --init
npm install

Compiling C module

Install third-party toolchains:

mkdir build
cd build
emcmake cmake -DCMAKE_BUILD_TYPE=Release ..
make -j8

Compiling b24.js library

npm run build

Getting Started

<script src="hls.min.js"></script>
<script src="b24.js"></script>
<video id="videoElement"></video>
<script>
    var video = document.getElementById('videoElement');
    var hls = new Hls();
    hls.loadSource('https://video-dev.github.io/streams/x36xhzz/x36xhzz.m3u8');
    hls.attachMedia(video);
    video.play();

    var b24Renderer = new b24js.WebVTTRenderer();
    b24Renderer.init().then(function() {
        b24Renderer.attachMedia(video);
        b24Renderer.show();
    });
    hls.on(Hls.Events.FRAG_PARSING_PRIVATE_DATA, function (event, data) {
        for (var sample of data.samples) {
            b24Renderer.pushData(sample.pid, sample.data, sample.pts);
        }
    }
</script>

Screenshoot

1.jpg

2.jpg

Third-party libraries

License

MIT License

Copyright (c) 2019 xqq <xqq@xqq.im>
1.0.3

5 years ago

1.0.2

5 years ago

1.0.1

5 years ago

1.0.0

5 years ago