New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@benshi.ai/bs-video

Package Overview
Dependencies
Maintainers
5
Versions
14
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@benshi.ai/bs-video

Stencil Component Starter

0.1.0
latest
npm
Version published
Weekly downloads
2
Maintainers
5
Weekly downloads
 
Created
Source

bs-video

bs-video is a wrapper over the native video element that automatically tracks the interactions (play, pause, etc) and sends the corresponding logs through @benshi.ai/js-sdk, which must be installed in the main application

Usage

In the main file of the project, import the module:

import '@benshi.ai/bs-video'

There is also need to include the polyfills to use the component within a framework:

import { applyPolyfills, defineCustomElements } from '@benshi.ai/bs-video/loader';


applyPolyfills().then(() => {
    defineCustomElements(window);
});

Finally, insert the <bs-video> tag in your HTML template:

<bs-video 
    ref={videoRef}
    media-id='video_123'
    src='<path to video>' 
    width='500' 
    controls
    content-block={ContentBlock.ELearning}
/>

Note the reference to the element. The reason for that is the need of an initialization:

import {
    Navigation,
    ContentBlock,
} from '@benshi-ai/js-sdk'

videoRef.current.injectNavigation(Navigation)

API

Properties

PropertyAttributeDescriptionTypeDefault
autoplayautoplayInherited from native componentbooleanundefined
contentBlockcontent-blockBlock where the video is inserted (i.e.: ContentBlock.ELearning, ContentBlock.ECommerce)stringundefined
controlscontrolsInherited from native componentbooleanundefined
heightheightInherited from native componentstringundefined
looploopInherited from native componentbooleanundefined
mediaIdmedia-idIdentifier for this video, as defined in the catalogstringundefined
metadatametadataObject with all the known properties of this media elementanyundefined
posterposterInherited from native componentstringundefined
srcsrcInherited from native componentstringundefined
widthwidthInherited from native componentstringundefined

Methods

injectNavigation(navigationModule: any) => Promise<void>

Call this method is mandatory to initialize the logger, otherwiser the component will be unable to send logs automatically

Returns

Type: Promise<void>

FAQs

Package last updated on 01 Aug 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts