Research
Security News
Quasar RAT Disguised as an npm Package for Detecting Vulnerabilities in Ethereum Smart Contracts
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
empplayer2-dev
Advanced tools
EMP HTML5 player is build on top of Open Source libraries.
VideoJS is an HTML5 video player that we use as a base to create our own player. VideoJS provides us with many common tasks required for modern video players. Including but not limited to
As such it is encouraged to re-use as much as possible from the VideoJS library. For more information about VideoJS
If you are a Redbee developer, you can check how to build the development version of the player here
Our releases are done via NPM. You can download the player just by running the following command:
npm install empplayer2
You can then link the javascript files in your webapp and initialize the player.
By default, the javascript file you should link from the NPM package is emp-player-all.min.js
.
For full UI compatibility, you must also include video.js stylesheets in your webapp:
<link rel="stylesheet" href="video-js/video-js.css">
<link rel="stylesheet" href="css/emp-player.css" />
<script src="js/emp-player-all.min.js"></script>
Using EMP-Player is as simple as creating a <video>
element, but with an additional data-setup
attribute. At a minimum, this attribute must have a value of '{}'
, but it can include any empPlayer options - just make sure it contains valid JSON!
<video
id="my-player"
class="video-js"
controls
preload="auto"
poster="//vjs.zencdn.net/v/oceans.png"
data-setup='{}'>
<source src=https://bitdash-a.akamaihd.net/content/sintel/hls/playlist.m3u8 type=application/x-mpegURL>
<source src=http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/BigBuckBunny.mp4 type=video/mp4>
<source src="https://demo.unified-streaming.com/video/tears-of-steel/tears-of-steel.ism/.mpd" type="application/dash+xml">
<source src="my_assetId" type="video/emp">
<source src='{"channelId":"750837_qwerty", "programId":"122345"}' type="video/emp">
</video>
When the page loads, EMP Player will find this element and automatically setup a player in its place.
If you don't want to use automatic setup, you can leave off the data-setup
attribute and initialize a <video>
element manually using the empPlayer
function:
var player = empPlayer('#my-player');
With type="video/emp" you also need to login:
let options = {
'ericssonexposure': {
'customer': 'TestGroup',
'businessUnit': 'Test',
'exposureApiURL': 'https://test.ebsd.ericsson.net'
},
}
let exposure = empPlayer.getExposure(options.ericssonexposure);
exposure.login('user', 'pw', function (response) {
if (response.success) {
options.ericssonexposure.sessionToken = response.session.sessionToken;
demoPlayer = new empPlayer('#my-player', options);
}
});
The empPlayer
function also accepts an options
object and a callback to be invoked
when the player is ready:
let options = {};
let player = empPlayer('my-player', options, function onPlayerReady() {
empPlayer.log('Your player is ready!');
// In this context, `this` is the player that was created by Video.js.
let assetId = 'MY_ASSET'; // VOD_ASSET, CHANNEL_ASSET OR PROGRAM_ASSET
let playbackProperties {
'playFrom': 'startTime'
'startTime': 1523547616290
};
player.startPlaybackV2(assetId, playbackProperties)
// How about an event listener?
player.on('ended', function() {
empPlayer.log('Awww...over so soon?!');
});
});
let options = {};
let player = empPlayer('my-player', options, function onPlayerReady() {
empPlayer.log('Your player is ready!');
// In this context, `this` is the player that was created by Video.js.
let assetId = 'MY_ASSET_ID_OR_NULL';
let channelId = 'MY_CHANNEL_ID_OR_NULL';
let programId = 'MY_PROGRAM_ID_OR_NULL';
let playbackProperties {
'playFrom': 'startTime'
'startTime': 1523547616290
};
player.startPlayback(assetId, channelId, programId, playbackProperties)
// How about an event listener?
player.on('ended', function() {
empPlayer.log('Awww...over so soon?!');
});
});
Note that in order for the playback to work, you need to pass the proper exposure options (as descrebed here). This is because every EMP asset has an entitlement associated to it, and that entitlement needs to be validated in our backend before the playback starts.
If you're ready to dive in, the Getting Started page and documentation are the best places to go for more information.
FAQs
EMP Player v2 SDK
The npm package empplayer2-dev receives a total of 83 weekly downloads. As such, empplayer2-dev popularity was classified as not popular.
We found that empplayer2-dev demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
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.
Research
Security News
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
Security News
Research
A supply chain attack on Rspack's npm packages injected cryptomining malware, potentially impacting thousands of developers.
Research
Security News
Socket researchers discovered a malware campaign on npm delivering the Skuld infostealer via typosquatted packages, exposing sensitive data.