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

youbora-adapter-hlsjs

Package Overview
Dependencies
Maintainers
1
Versions
36
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

youbora-adapter-hlsjs - npm Package Compare versions

Comparing version 6.4.6 to 6.4.7

6

CHANGELOG.md

@@ -0,1 +1,7 @@

## [6.4.7] - 2019-04-29
### Fixed
- Fake start prevented when autoplay is enabled and blocked by the browser again, checking both `progress` and `play` events
### Library
- Packaged with `lib 6.4.25`
## [6.4.6] - 2019-04-05

@@ -2,0 +8,0 @@ ### Library

6

manifest.json

@@ -6,6 +6,6 @@ {

"author": "Jesus Lopez",
"version": "6.4.6",
"built": "2019-04-05",
"version": "6.4.7",
"built": "2019-04-29",
"repo": "https://bitbucket.org/npaw/hlsjs-adapter-js",
"libVersion": "^6.4.23",
"libVersion": "^6.4.25",
"features": {

@@ -12,0 +12,0 @@ "buffer": "native",

{
"name": "youbora-adapter-hlsjs",
"version": "6.4.6",
"main": "src/adapter.js",
"description": "Youbora adapter for hlsjs",
"scripts": {
"build": "npm run manifest && webpack -p",
"watch": "npm run manifest && webpack -p --progress --color --watch",
"deployable": "npm run build && youbora-util deployable",
"manifest": "youbora-util manifest",
"preversion": "npm run build",
"clean": "rm -rf dist deploy manifest.json"
},
"dependencies": {
"youboralib": "^6.4.23"
},
"devDependencies": {
"webpack": "^4.15.1",
"webpack-cli": "^3.0.8",
"youboralib-util": "1.3.x"
},
"repository": {
"type": "git",
"url": "git+https://bitbucket.org/npaw/hlsjs-adapter-js"
},
"author": "Jesus Lopez",
"license": "MIT",
"bugs": {
"email": "support@nicepeopleatwork.com"
}
"name": "youbora-adapter-hlsjs",
"version": "6.4.7",
"main": "src/adapter.js",
"description": "Youbora adapter for hlsjs",
"scripts": {
"build": "npm run manifest && webpack -p",
"watch": "npm run manifest && webpack -p --progress --color --watch",
"deployable": "npm run build && youbora-util deployable",
"manifest": "youbora-util manifest",
"preversion": "npm run build",
"clean": "rm -rf dist deploy manifest.json"
},
"dependencies": {
"youboralib": "^6.4.25"
},
"devDependencies": {
"webpack": "^4.30.0",
"webpack-cli": "^3.3.1",
"youboralib-util": "1.3.x"
},
"repository": {
"type": "git",
"url": "git+https://bitbucket.org/npaw/hlsjs-adapter-js"
},
"author": "Jesus Lopez",
"license": "MIT",
"bugs": {
"email": "support@nicepeopleatwork.com"
}
}

@@ -5,205 +5,206 @@ var youbora = require('youboralib')

youbora.adapters.Hlsjs = youbora.Adapter.extend({
/** Override to return current plugin version */
getVersion: function () {
return manifest.version + '-' + manifest.name + '-' + manifest.tech
},
/** Override to return current plugin version */
getVersion: function() {
return manifest.version + '-' + manifest.name + '-' + manifest.tech
},
/** Override to return current playhead of the video */
getPlayhead: function () {
if (this.tag) {
return this.tag.currentTime
}
return null
},
/** Override to return current playhead of the video */
getPlayhead: function() {
if (this.tag) {
return this.tag.currentTime
}
return null
},
/** Override to return current playrate */
getPlayrate: function () {
if (this.flags.isPaused) return 0
if (this.tag) {
return this.tag.playbackRate
}
return null
},
/** Override to return current playrate */
getPlayrate: function() {
if (this.flags.isPaused) return 0
if (this.tag) {
return this.tag.playbackRate
}
return null
},
/** Override to return dropped frames since start */
getDroppedFrames: function () {
if (this.tag) {
return this.tag.webkitDroppedFrameCount
}
return null
},
/** Override to return dropped frames since start */
getDroppedFrames: function() {
if (this.tag) {
return this.tag.webkitDroppedFrameCount
}
return null
},
/** Override to return video duration */
getDuration: function () {
if (this.tag && !this.getIsLive()) {
return this.tag.duration
}
return null
},
/** Override to return video duration */
getDuration: function() {
if (this.tag && !this.getIsLive()) {
return this.tag.duration
}
return null
},
/** Override to return current bitrate */
getBitrate: function () {
if (this.player.currentLevel != -1 && this.player.levels[this.player.currentLevel]) {
return this.player.levels[this.player.currentLevel].bitrate
}
return null
},
/** Override to return current bitrate */
getBitrate: function() {
if (this.player.currentLevel != -1 && this.player.levels[this.player.currentLevel]) {
return this.player.levels[this.player.currentLevel].bitrate
}
return null
},
/** Override to return rendition */
getRendition: function () {
if (this.player.currentLevel != -1) {
var level = this.player.levels[this.player.currentLevel]
if (level) {
if (level.name) {
return level.name
} else {
if (level.bitrate) {
return youbora.Util.buildRenditionString(level.width, level.height, level.bitrate)
}
return null
/** Override to return rendition */
getRendition: function() {
if (this.player.currentLevel != -1) {
var level = this.player.levels[this.player.currentLevel]
if (level) {
if (level.name) {
return level.name
} else {
if (level.bitrate) {
return youbora.Util.buildRenditionString(level.width, level.height, level.bitrate)
}
return null
}
}
}
}
}
return null
},
return null
},
/** Override to return true if live and false if VOD */
getIsLive: function () {
if (this.player.levels[this.player.currentLevel]) {
return this.player.levels[this.player.currentLevel].details.live
}
return null
},
/** Override to return true if live and false if VOD */
getIsLive: function() {
if (this.player.levels[this.player.currentLevel]) {
return this.player.levels[this.player.currentLevel].details.live
}
return null
},
/** Override to return resource URL. */
getResource: function () {
return this.player.url
},
/** Override to return resource URL. */
getResource: function() {
return this.player.url
},
/** Override to return player version */
getPlayerVersion: function () {
return (typeof Hls != "undefined") ? Hls.version : 'unknown'
},
/** Override to return player version */
getPlayerVersion: function() {
return (typeof Hls != "undefined") ? Hls.version : 'unknown'
},
/** Override to return player's name */
getPlayerName: function () {
return 'Hls.js'
},
/** Override to return player's name */
getPlayerName: function() {
return 'Hls.js'
},
/** Register listeners to this.player. */
registerListeners: function () {
if (!this.mediaFound) {
// Enable playhead monitor (buffer = true, seek = false)
this.monitorPlayhead(true, true)
this.hlsReference = this.hlsErrorListener.bind(this)
this.hlsMediaReference = this.getTagListener.bind(this)
this.player.on("hlsError", this.hlsReference, this)
this.player.on("hlsMediaAttached", this.hlsMediaReference)
} else {
if (!this.hlsReference && !this.hlsMediaReference) {
this.tag = this.player ? this.player.media : null
this.monitorPlayhead(true, true)
this.hlsReference = this.hlsErrorListener.bind(this)
this.hlsMediaReference = this.getTagListener.bind(this)
this.player.on("hlsError", this.hlsReference, this)
this.player.on("hlsMediaAttached", this.hlsMediaReference)
}
// References
this.references = []
this.references['play'] = this.playListener.bind(this)
this.references['pause'] = this.pauseListener.bind(this)
this.references['playing'] = this.playingListener.bind(this)
this.references['error'] = this.errorListener.bind(this)
this.references['ended'] = this.endedListener.bind(this)
this.references['progress'] = this.progressListener.bind(this)
/** Register listeners to this.player. */
registerListeners: function() {
if (!this.mediaFound) {
// Enable playhead monitor (buffer = true, seek = false)
this.monitorPlayhead(true, true)
this.hlsReference = this.hlsErrorListener.bind(this)
this.hlsMediaReference = this.getTagListener.bind(this)
this.player.on("hlsError", this.hlsReference, this)
this.player.on("hlsMediaAttached", this.hlsMediaReference)
} else {
if (!this.hlsReference && !this.hlsMediaReference) {
this.tag = this.player ? this.player.media : null
this.monitorPlayhead(true, true)
this.hlsReference = this.hlsErrorListener.bind(this)
this.hlsMediaReference = this.getTagListener.bind(this)
this.player.on("hlsError", this.hlsReference, this)
this.player.on("hlsMediaAttached", this.hlsMediaReference)
}
// References
this.references = []
this.references['play'] = this.playListener.bind(this)
this.references['pause'] = this.pauseListener.bind(this)
this.references['playing'] = this.playingListener.bind(this)
this.references['error'] = this.errorListener.bind(this)
this.references['ended'] = this.endedListener.bind(this)
this.references['progress'] = this.progressListener.bind(this)
// Register listeners
for (var key in this.references) {
this.tag.addEventListener(key, this.references[key])
}
}
},
// Register listeners
for (var key in this.references) {
this.tag.addEventListener(key, this.references[key])
}
}
},
/** Unregister listeners to this.player. */
unregisterListeners: function () {
// Disable playhead monitoring
this.monitor.stop()
// unregister listeners
if (this.player && this.hlsReference) {
this.player.off("hlsError", this.hlsReference, this)
this.hlsReference = null
}
if (this.player && this.hlsMediaReference) {
this.player.off("hlsMediaAttached", this.hlsMediaReference)
this.hlsMediaReference = null
}
if (this.tag && this.references) {
for (var key in this.references) {
this.tag.removeEventListener(key, this.references[key])
}
this.references = []
}
/** Unregister listeners to this.player. */
unregisterListeners: function() {
// Disable playhead monitoring
if (this.monitor) this.monitor.stop()
// unregister listeners
if (this.player && this.hlsReference) {
this.player.off("hlsError", this.hlsReference, this)
this.hlsReference = null
}
if (this.player && this.hlsMediaReference) {
this.player.off("hlsMediaAttached", this.hlsMediaReference)
this.hlsMediaReference = null
}
if (this.tag && this.references) {
for (var key in this.references) {
this.tag.removeEventListener(key, this.references[key])
}
this.references = []
}
},
progressListener: function (e) {
if (!this.flags.isStarted && this.getPlayhead() > 0.2) {
this.fireStart()
this.fireJoin()
}
},
/** Listener for 'play' event. */
playListener: function (e) {
this.fireStart()
},
},
progressListener: function(e) {
if (!this.flags.isStarted && this.getPlayhead() > 0.2 && this.startedOnce) {
this.fireStart()
this.fireJoin()
}
},
/** Listener for 'play' event. */
playListener: function(e) {
this.fireStart()
this.startedOnce = true
},
/** Listener for 'pause' event. */
pauseListener: function (e) {
this.firePause()
this.pauseStamp = e.timeStamp
},
/** Listener for 'pause' event. */
pauseListener: function(e) {
this.firePause()
this.pauseStamp = e.timeStamp
},
/** Listener for 'playing' event. */
playingListener: function (e) {
var thisStamp = e.timeStamp
if (this.flags.isPaused) {
if (this.chronos.pause.getDeltaTime() <= 0) {
/** Listener for 'playing' event. */
playingListener: function(e) {
var thisStamp = e.timeStamp
if (this.flags.isPaused) {
if (this.chronos.pause.getDeltaTime() <= 0) {
this.fireResume()
this.fireBufferBegin()
} else if (this.chronos.pause.getDeltaTime() <= 100 &&
this.pauseStamp != thisStamp) {
this.fireSeekBegin()
this.fireSeekEnd()
}
}
this.fireJoin()
this.fireBufferEnd()
this.fireSeekEnd()
this.fireResume()
this.fireBufferBegin()
} else if (this.chronos.pause.getDeltaTime() <= 100
&& this.pauseStamp != thisStamp) {
this.fireSeekBegin()
this.fireSeekEnd()
}
}
this.fireJoin()
this.fireBufferEnd()
this.fireSeekEnd()
this.fireResume()
},
},
/** Listener for 'error' event. */
errorListener: function (e) {
this.fireError(this.tag.error.code, "PLAY FAILURE")
},
/** Listener for 'error' event. */
errorListener: function(e) {
this.fireError(this.tag.error.code, "PLAY FAILURE")
},
/** Listener for 'ended' event. */
endedListener: function (e) {
this.fireStop()
},
/** Listener for 'ended' event. */
endedListener: function(e) {
this.fireStop()
},
/** Listener for 'error' hls event. */
hlsErrorListener: function (event, error) {
if (error.fatal) {
this.fireError(error.details, "PLAYER FAILURE")
this.fireStop()
/** Listener for 'error' hls event. */
hlsErrorListener: function(event, error) {
if (error.fatal) {
this.fireError(error.details, "PLAYER FAILURE")
this.fireStop()
}
},
getTagListener: function() {
this.tag = this.player ? this.player.media : null
this.mediaFound = true
this.registerListeners()
}
},
getTagListener: function () {
this.tag = this.player ? this.player.media : null
this.mediaFound = true
this.registerListeners()
}
})
module.exports = youbora.adapters.Hlsjs
module.exports = youbora.adapters.Hlsjs
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc