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

@web-kks/kks-player-sdk

v0.1.0-beta.2

Published

The BlendVision Player SDK is a web video player which supports video playback. You can check the demo [here](https://playcraft-v1-10-0-canary-0-ii72jy5u8-kksweb.vercel.app/player-sdk?autoplay=true&mockContentId=2).

Downloads

4

Readme

BlendVision Player SDK

The BlendVision Player SDK is a web video player which supports video playback. You can check the demo here.

How to Install?

There are 2 methods to install BlendVision Player SDK as described below. You can install BlendVision Player SDK through npm:

npm install @web-kks/blendvision-player-sdk-for-web

Alternatively, you can refer to an up‐to‐date version on our CDN:

<script src="https://unpkg.com/@web-kks/blendvision-player-sdk-for-web"></script>

How to Create a Player?

Create an instance of this player class.

<!-- the element where you would like to display the player -->
<div id='my-player'></div>

<script src='https://unpkg.com/@web-kks/blendvision-player-sdk-for-web'></script>
<script>
  var config = {
    title: 'Title',
    source: '...',
  }
  var player = BlendVision.Player('my-player', config)
</script>

Source

An object or an array of objects contains {type, src}.

  • Type: type of manifests
  • Src: manifest URL of video
[
  {
    type: 'dash',
    src: 'https://storage.googleapis.com/shaka-demo-assets/bbb-dark-truths/dash.mpd',
  },
  {
    type: 'hls',
    src: 'https://storage.googleapis.com/shaka-demo-assets/bbb-dark-truths-hls/hls.m3u8',
  }
]

In iOS browsers and macOS Safari, the player chooses the first HLS manifest and plays with built-in player provided by Apple.

In other browsers, the player looks for the first DASH manifest and plays with MediaSource Extensions.

DRM

To play videos with content protection, you should specify license server URLs and options in drm:

[
  {
    type: 'dash',
    src: 'https://storage.googleapis.com/shaka-demo-assets/bbb-dark-truths/dash.mpd',
    drm: {
      widevine: 'https://drm.ex.com/portal',
      playready: 'https://drm.ex.com/portal',
    }
  },
  {
    type: 'hls',
    src: 'https://storage.googleapis.com/shaka-demo-assets/bbb-dark-truths-hls/hls.m3u8',
    drm: {
      fairplay: {
        licenseUri: 'https://drm.ex.com/portal',
        certificateUri: 'https://drm.ex.com/portal/certificate'
      }
    }
  }
]

source.drm.widevine.level

Due to the best compatibility, in most situations, there’s no need to set Widevine level.

Actual robustness/security level is determined by the browser, it may use L3 even if L1 works well.

When you view the below message in the console on Chrome, it is safe to ignore.

It is recommended that a robustness level be specified. Not specifying the robustness level could result in unexpected behavior, potentially including failure to play.

  • In the case of hardware based content protection(L1) is required, please set HW_SECURE_DECODE.
  • If you have a list of devices that don't play well with L1, please set SW_SECURE_DECODE to force L3.
  • For advanced or experimental usage, the possible value is one of SW_SECURE_CRYPTO, SW_SECURE_DECODE, HW_SECURE_CRYPTO, HW_SECURE_DECODE, and HW_SECURE_ALL, which is specific to Widevine and not supported in other key systems.

Features & Definition

Play

This method plays a video.

player.play()

Pause

This method pauses the playback of a video.

player.pause()

Seek

This method sets the current playback position in seconds, or gets the current playback position of a video.

player.seek(50) // Set the current playback position to 50 seconds
var current = player.seek() // `current` is the current position in seconds

Forward

This method seeks forward the current playback position in seconds.

player.forward() // Forward 10 seconds
player.forward(100) // Forward 100 seconds

Rewind

This method rewinds the current playback position in seconds.

player.rewind() // Rewind 10 seconds
player.rewind(100) // Rewind 100 seconds

UI Controls

This method sets the UI state if state is given, or gets current UI state.

player.uiControls('SHOW') // Show UI
player.uiControls('HIDE') // Hide UI
player.uiControls('AUTOHIDE') // Make UI auto hide
var current = player.uiControls() // `current` is the current UI state

Volume

This method sets the volume level of player on a scale from 0 to 1, or gets the volume level.

player.volume(0.5) // Set volume to 50%
var current = player.volume() // `current` is the current volume

Mute

This method mutes the player.

player.mute() // Mute the player

Unmute

This method unmutes the player.

player.unmute() // Unmute the player

Release

This method removes the player.

player.release() // Release the player