Comparing version 0.2.61 to 0.2.62
{ | ||
"name": "clappr", | ||
"description": "An extensible media player for the web", | ||
"version": "0.2.61", | ||
"homepage": "https://github.com/Bruno%20Torres/clappr", | ||
"version": "0.2.62", | ||
"homepage": "https://github.com/Leandro%20Moreira/clappr", | ||
"authors": [ | ||
"Globo.com" | ||
], | ||
"repository": "Bruno%20Torres/clappr", | ||
"repository": "Leandro%20Moreira/clappr", | ||
"bugs": { | ||
@@ -38,3 +38,3 @@ "url": "https://github.com/clappr/clappr/issues" | ||
"gulp": "^3.8.1", | ||
"hls.js": "^0.5.42", | ||
"hls.js": "^0.5.45", | ||
"html-loader": "^0.4.3", | ||
@@ -41,0 +41,0 @@ "isparta": "^4.0.0", |
@@ -15,3 +15,2 @@ ## External Plugins | ||
RTMP | Ready | Yes | https://github.com/clappr/clappr-rtmp-plugin | ||
Bandwidth Analyzer | Ready | Yes | https://github.com/mediahub-bg/clappr-bandwidth-analyzer | ||
Picture-in-Picture | Ready | Yes | https://github.com/tjenkinson/clappr-pip-plugin | ||
@@ -18,0 +17,0 @@ HLS+P2P | Ready | [WIP](https://github.com/bemtv/clappr-p2phls-plugin/issues/148) | http://bem.tv |
@@ -29,2 +29,3 @@ ## FAQ & Troubleshooting | ||
```bash | ||
pip install m3u8 | ||
git clone https://github.com/epiclabs-io/hls-analyzer.git | ||
@@ -31,0 +32,0 @@ cd hls-analyzer |
{ | ||
"name": "clappr", | ||
"version": "0.2.61", | ||
"version": "0.2.62", | ||
"description": "An extensible media player for the web", | ||
@@ -44,3 +44,3 @@ "main": "./dist/clappr.js", | ||
"gulp": "^3.8.1", | ||
"hls.js": "^0.5.42", | ||
"hls.js": "^0.5.45", | ||
"html-loader": "^0.4.3", | ||
@@ -47,0 +47,0 @@ "isparta": "^4.0.0", |
@@ -32,2 +32,6 @@ [![npm version](https://badge.fury.io/js/clappr.svg)](http://badge.fury.io/js/clappr) | ||
## Live Demo | ||
Test it at [cdn.clappr.io.](http://cdn.clappr.io/?src=http://www.streambox.fr/playlists/x36xhzz/x36xhzz.m3u8) | ||
## CDN | ||
@@ -47,2 +51,4 @@ | ||
## [Events API](doc/API_EVENTS.md) | ||
## [External Plugins](doc/EXTERNAL_PLUGINS.md) | ||
@@ -49,0 +55,0 @@ |
@@ -36,11 +36,20 @@ // Copyright 2014 Globo.com Player authors. All rights reserved. | ||
const triggerEvents = function(events, args) { | ||
const triggerEvents = function(events, args, klass, name) { | ||
let ev, i = -1 | ||
const l = events.length, a1 = args[0], a2 = args[1], a3 = args[2] | ||
switch (args.length) { | ||
case 0: while (++i < l) { (ev = events[i]).callback.call(ev.ctx) } return | ||
case 1: while (++i < l) { (ev = events[i]).callback.call(ev.ctx, a1) } return | ||
case 2: while (++i < l) { (ev = events[i]).callback.call(ev.ctx, a1, a2) } return | ||
case 3: while (++i < l) { (ev = events[i]).callback.call(ev.ctx, a1, a2, a3) } return | ||
default: while (++i < l) { (ev = events[i]).callback.apply(ev.ctx, args) } return | ||
run() | ||
function run() { | ||
try { | ||
switch (args.length) { | ||
case 0: while (++i < l) { (ev = events[i]).callback.call(ev.ctx) } return | ||
case 1: while (++i < l) { (ev = events[i]).callback.call(ev.ctx, a1) } return | ||
case 2: while (++i < l) { (ev = events[i]).callback.call(ev.ctx, a1, a2) } return | ||
case 3: while (++i < l) { (ev = events[i]).callback.call(ev.ctx, a1, a2, a3) } return | ||
default: while (++i < l) { (ev = events[i]).callback.apply(ev.ctx, args) } return | ||
} | ||
} catch (exception) { | ||
Log.error.apply(Log, [klass, 'error on event', name, 'trigger','-', exception]) | ||
run() | ||
} | ||
} | ||
@@ -131,14 +140,10 @@ } | ||
const klass = this.name || this.constructor.name | ||
try { | ||
Log.debug.apply(Log, [klass].concat(Array.prototype.slice.call(arguments))) | ||
if (!this._events) {return this} | ||
const args = slice.call(arguments, 1) | ||
if (!eventsApi(this, 'trigger', name, args)) {return this} | ||
const events = this._events[name] | ||
const allEvents = this._events.all | ||
if (events) {triggerEvents(events, args)} | ||
if (allEvents) {triggerEvents(allEvents, arguments)} | ||
} catch (exception) { | ||
Log.error.apply(Log, [klass, 'error on event', name, 'trigger','-', exception]) | ||
} | ||
Log.debug.apply(Log, [klass].concat(Array.prototype.slice.call(arguments))) | ||
if (!this._events) {return this} | ||
const args = slice.call(arguments, 1) | ||
if (!eventsApi(this, 'trigger', name, args)) {return this} | ||
const events = this._events[name] | ||
const allEvents = this._events.all | ||
if (events) {triggerEvents(events, args, klass, name)} | ||
if (allEvents) {triggerEvents(allEvents, arguments, klass, name)} | ||
return this | ||
@@ -145,0 +150,0 @@ } |
@@ -21,2 +21,3 @@ // Copyright 2014 Globo.com Player authors. All rights reserved. | ||
import $ from 'clappr-zepto' | ||
import merge from 'lodash.merge' | ||
@@ -84,2 +85,3 @@ import mediaControlStyle from './public/media-control.scss' | ||
this.keepVisible = false | ||
this.fullScreenOnVideoTagSupported = null // unknown | ||
this.addEventListeners() | ||
@@ -125,2 +127,6 @@ this.settings = { | ||
this.listenTo(this.container, Events.CONTAINER_VOLUME, this.onVolumeChanged) | ||
if (this.container.playback.el.nodeName.toLowerCase() === 'video') { | ||
// wait until the metadata has loaded and then check if fullscreen on video tag is supported | ||
this.listenToOnce(this.container, Events.CONTAINER_LOADEDMETADATA, this.onLoadedMetadataOnVideoTag) | ||
} | ||
} | ||
@@ -157,2 +163,12 @@ } | ||
onLoadedMetadataOnVideoTag() { | ||
let video = this.container.playback.el | ||
// video.webkitSupportsFullscreen is deprecated but iOS appears to only use this | ||
// see https://github.com/clappr/clappr/issues/1127 | ||
if (!Fullscreen.fullscreenEnabled() && video.webkitSupportsFullscreen) { | ||
this.fullScreenOnVideoTagSupported = true | ||
this.settingsUpdate() | ||
} | ||
} | ||
updateVolumeUI() { | ||
@@ -346,2 +362,3 @@ if (!this.rendered) { | ||
this.stopListening(this.container) | ||
this.fullScreenOnVideoTagSupported = null | ||
} | ||
@@ -486,4 +503,4 @@ Mediator.off(`${this.options.playerId}:${Events.PLAYER_RESIZE}`, this.playerResize, this) | ||
settingsUpdate() { | ||
const newSettings = $.extend({}, this.container.settings) | ||
if (newSettings && !Fullscreen.fullscreenEnabled()) { | ||
const newSettings = merge({}, this.container.settings) | ||
if (newSettings && !this.fullScreenOnVideoTagSupported && !Fullscreen.fullscreenEnabled()) { | ||
// remove fullscreen from settings if it is present | ||
@@ -490,0 +507,0 @@ newSettings.default && removeArrayItem(newSettings.default, 'fullscreen') |
@@ -125,3 +125,3 @@ // Copyright 2014 Globo.com Player authors. All rights reserved. | ||
// https://github.com/clappr/clappr/issues/1076 | ||
this.options.autoPlay && this.play() | ||
this.options.autoPlay && process.nextTick(() => this.play()) | ||
} | ||
@@ -382,5 +382,8 @@ | ||
_typeFor(src) { | ||
const resourceParts = src.split('?')[0].match(/.*\.(.*)$/) || [] | ||
const isHls = resourceParts.length > 1 && resourceParts[1] === 'm3u8' | ||
return isHls ? 'application/vnd.apple.mpegurl' : 'video/mp4' | ||
let mimeTypes = HTML5Video._mimeTypesForUrl(src, MIMETYPES, this.options.mimeType) | ||
if (mimeTypes.length == 0) { | ||
mimeTypes = HTML5Video._mimeTypesForUrl(src, AUDIO_MIMETYPES, this.options.mimeType) | ||
} | ||
const mimeType = mimeTypes[0] || '' | ||
return mimeType.split(';')[0] | ||
} | ||
@@ -399,3 +402,3 @@ | ||
this._src && this.$el.html(this.template({ src: this._src, type: this._typeFor(this._src) })) | ||
this._src && this.$el.html(this.template({ src: this._src, type: this.options.mimeType || this._typeFor(this._src) })) | ||
@@ -402,0 +405,0 @@ if (this.options.playback.disableContextMenu) { |
@@ -16,2 +16,3 @@ import CorePlugin from 'base/core_plugin' | ||
super(core) | ||
this._container = null | ||
this.configure() | ||
@@ -41,8 +42,9 @@ } | ||
containerChanged() { | ||
this.stopListening(this.core.mediaControl.container) | ||
this.listenTo(this.core.mediaControl.container, Events.CONTAINER_PLAY, this.setPlayIcon) | ||
this.listenTo(this.core.mediaControl.container, Events.CONTAINER_PAUSE, this.setPauseIcon) | ||
this.listenTo(this.core.mediaControl.container, Events.CONTAINER_STOP, this.resetIcon) | ||
this.listenTo(this.core.mediaControl.container, Events.CONTAINER_ENDED, this.resetIcon) | ||
this.listenTo(this.core.mediaControl.container, Events.CONTAINER_ERROR, this.resetIcon) | ||
this._container && this.stopListening(this._container) | ||
this._container = this.core.mediaControl.container | ||
this.listenTo(this._container, Events.CONTAINER_PLAY, this.setPlayIcon) | ||
this.listenTo(this._container, Events.CONTAINER_PAUSE, this.setPauseIcon) | ||
this.listenTo(this._container, Events.CONTAINER_STOP, this.resetIcon) | ||
this.listenTo(this._container, Events.CONTAINER_ENDED, this.resetIcon) | ||
this.listenTo(this._container, Events.CONTAINER_ERROR, this.resetIcon) | ||
this.resetIcon() | ||
@@ -49,0 +51,0 @@ } |
@@ -50,2 +50,7 @@ import {getBrowserLanguage} from 'base/utils' | ||
'playback_not_supported': 'Su navegador no soporta la reproducción de un video. Por favor, trate de usar un navegador diferente.' | ||
}, | ||
'ru': { | ||
'live': 'прямой эфир', | ||
'back_to_live': 'к прямому эфиру', | ||
'playback_not_supported': 'Ваш браузер не поддерживает воспроизведение этого видео. Пожалуйста, попробуйте другой браузер.' | ||
} | ||
@@ -52,0 +57,0 @@ }, this.core.options.strings || {}) |
@@ -22,3 +22,3 @@ /* eslint-disable no-var */ | ||
filename: 'clappr.js', | ||
library: 'Clappr', | ||
library: ['clappr', 'Clappr'], | ||
libraryTarget: 'umd' | ||
@@ -25,0 +25,0 @@ } |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Native code
Supply chain riskContains native code (e.g., compiled binaries or shared libraries). Including native code can obscure malicious behavior.
Found 1 instance in 1 package
Mixed license
License(Experimental) Package contains multiple licenses.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
7788909
214
41090
97
1
5