From f62ae6d777ab565d64a1cb4428b69c4b01a4d41a Mon Sep 17 00:00:00 2001 From: Samuel Guillemet Date: Tue, 1 Aug 2023 11:40:38 +0200 Subject: [PATCH 1/6] =?UTF-8?q?=F0=9F=93=96=20DOC:=20Add=20badges?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index 0247930..82accba 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,7 @@ # Cern Paella Plugins +[![Build and push to NPM](https://github.com/cern-vc/cern-paella-plugins/actions/workflows/build.yml/badge.svg)](https://github.com/cern-vc/cern-paella-plugins/actions/workflows/build.yml) + This repository contains the plugins for the Paella Player used at CERN. ## Available plugins From 84fc6f24a6cd95989c72d5472f22709dc98fc1bd Mon Sep 17 00:00:00 2001 From: Samuel Guillemet Date: Tue, 1 Aug 2023 11:40:55 +0200 Subject: [PATCH 2/6] =?UTF-8?q?=F0=9F=93=A6=20NEW:=20Add=20webpack=20confi?= =?UTF-8?q?gs?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- webpack.common.js | 45 +++++++++++++++++++++++++++++++++++++++++++++ webpack.config.js | 19 +++++++++++++++++++ webpack.debug.js | 35 +++++++++++++++++++++++++++++++++++ 3 files changed, 99 insertions(+) create mode 100644 webpack.common.js create mode 100644 webpack.config.js create mode 100644 webpack.debug.js diff --git a/webpack.common.js b/webpack.common.js new file mode 100644 index 0000000..7a7054c --- /dev/null +++ b/webpack.common.js @@ -0,0 +1,45 @@ +module.exports = { + + devtool: 'source-map', + + module: { + rules: [ + { + test: /\.js$/, + exclude: /(node_modules)/, + use: { + loader: 'babel-loader', + options: { + presets: ['@babel/preset-env'] + } + } + }, + { + test: /\.(svg)$/i, + exclude: /(node_modules)/, + use: [ + { + loader: 'svg-inline-loader' + } + ] + }, + { + test: /\.(png|jpe?g|gif)$/i, + exclude: /(node_modules)/, + use: [ + { + loader: 'file-loader' + } + ] + }, + { + test: /\.css$/i, + use: ['style-loader', 'css-loader'], + exclude: /(node_modules)/ + } + ] + }, + + plugins: [ + ] +} diff --git a/webpack.config.js b/webpack.config.js new file mode 100644 index 0000000..156eb57 --- /dev/null +++ b/webpack.config.js @@ -0,0 +1,19 @@ +const path = require('path'); +const config = require('./webpack.common'); + +config.entry = './src/index.js', +config.output = { + path: path.join(__dirname, "dist"), + filename: 'cern-paella-plugins.js', + library: 'cern-paella-plugins', + libraryTarget: 'umd' +}; +config.externals = { + "paella-core": { + commonjs: 'paella-core', + commonjs2: 'paella-core', + amd: 'paella-core' + } +}; + +module.exports = config; diff --git a/webpack.debug.js b/webpack.debug.js new file mode 100644 index 0000000..8388a46 --- /dev/null +++ b/webpack.debug.js @@ -0,0 +1,35 @@ +const path = require('path'); +const config = require('./webpack.common'); +const HtmlWebpackPlugin = require('html-webpack-plugin'); +const CopyWebpackPlugin = require('copy-webpack-plugin'); + +config.entry = './src/debug.js'; +config.output = { + path: path.join(__dirname, "debug"), + filename: 'paella.js', + sourceMapFilename: 'paella.js.map' +} +config.devtool = "source-map"; +config.devServer = { + port: 8090, + allowedHosts: 'all', + headers: { + "Access-Control-Allow-Origin": "*", + "Access-Control-Allow-Methods": "GET, POST, PUT, DELETE, PATCH, OPTIONS", + "Access-Control-Allow-Headers": "X-Requested-With, content-type, Authorization" + } +}; + +config.plugins.push(new HtmlWebpackPlugin({ + template: "src/index.html", + inject: true +})); + +config.plugins.push(new CopyWebpackPlugin({ + patterns: [ + { from: 'config', to: 'config' }, + { from: 'repository_test/repository', to: 'repository' } + ] +})); + +module.exports = config; From e5ead2ed0c0875a0345507829fac9cae203d8e19 Mon Sep 17 00:00:00 2001 From: Samuel Guillemet Date: Tue, 1 Aug 2023 11:41:05 +0200 Subject: [PATCH 3/6] =?UTF-8?q?=F0=9F=91=8C=20IMPROVE:=20Add=20gitignore?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitignore | 1 + 1 file changed, 1 insertion(+) create mode 100644 .gitignore diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..c2658d7 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +node_modules/ From c4c942bd0fa32e8fac2409d427a97520e903b0fc Mon Sep 17 00:00:00 2001 From: Samuel Guillemet Date: Tue, 1 Aug 2023 11:41:43 +0200 Subject: [PATCH 4/6] =?UTF-8?q?=F0=9F=93=A6=20NEW:=20Add=20first=20plugin?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/index.js | 3 +++ src/plugins/CernPaellaPlugins.js | 13 +++++++++++++ src/plugins/ch.cern.paella.testButton.js | 19 +++++++++++++++++++ 3 files changed, 35 insertions(+) create mode 100644 src/index.js create mode 100644 src/plugins/CernPaellaPlugins.js create mode 100644 src/plugins/ch.cern.paella.testButton.js diff --git a/src/index.js b/src/index.js new file mode 100644 index 0000000..6ff428f --- /dev/null +++ b/src/index.js @@ -0,0 +1,3 @@ +export default function getCernCustomPluginsContext() { + return require.context("./plugins", true, /\.js/); +} diff --git a/src/plugins/CernPaellaPlugins.js b/src/plugins/CernPaellaPlugins.js new file mode 100644 index 0000000..7abd74a --- /dev/null +++ b/src/plugins/CernPaellaPlugins.js @@ -0,0 +1,13 @@ +import { PluginModule } from 'paella-core'; +import packageData from '../../package.json'; + +export default class TutorialPlugins extends PluginModule { + get moduleName() { + return 'cern-paella-plugins'; + } + + get moduleVersion() { + return packageData.version; + } + +} diff --git a/src/plugins/ch.cern.paella.testButton.js b/src/plugins/ch.cern.paella.testButton.js new file mode 100644 index 0000000..3da9609 --- /dev/null +++ b/src/plugins/ch.cern.paella.testButton.js @@ -0,0 +1,19 @@ +import { ButtonPlugin } from "paella-core"; + +export default class TestButtonPlugin extends ButtonPlugin { + async load() { + this.title = "Login"; + } + + static get side() { + return "right"; // or right + } + + static get parentContainer() { + return "videoContainer"; // or videoContainer + } + + static async action() { + console.log("Test"); + } +} From 69a4b1a1251a410cf230b40cb978c12fee4c9481 Mon Sep 17 00:00:00 2001 From: Samuel Guillemet Date: Tue, 1 Aug 2023 11:42:02 +0200 Subject: [PATCH 5/6] =?UTF-8?q?=F0=9F=93=A6=20NEW:=20Add=20test=20utilitie?= =?UTF-8?q?s?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- config/config.json | 358 ++++++++++++++++++ .../repository/test-video/data.json | 45 +++ src/debug.js | 13 + src/index.html | 22 ++ 4 files changed, 438 insertions(+) create mode 100644 config/config.json create mode 100644 repository_test/repository/test-video/data.json create mode 100644 src/debug.js create mode 100644 src/index.html diff --git a/config/config.json b/config/config.json new file mode 100644 index 0000000..2523277 --- /dev/null +++ b/config/config.json @@ -0,0 +1,358 @@ +{ + "repositoryUrl": "repository", + "manifestFileName": "data.json", + "defaultLayout": "presenter-presentation", + "plugins": { + "es.upv.paella.singleVideo": { + "enabled": true, + "validContent": [ + { + "id": "presenter", + "content": [ + "presenter" + ], + "icon": "present-mode-2.svg", + "title": "Presenter" + }, + { + "id": "presentation", + "content": [ + "presentation" + ], + "icon": "present-mode-1.svg", + "title": "Presentation" + }, + { + "id": "presenter-2", + "content": [ + "presenter-2" + ], + "icon": "present-mode-1.svg", + "title": "Presentation" + } + ] + }, + "es.upv.paella.dualVideo": { + "enabled": true, + "validContent": [ + { + "id": "presenter-presentation", + "content": [ + "presenter", + "presentation" + ], + "icon": "present-mode-3.svg", + "title": "Presenter and presentation" + }, + { + "id": "presenter-2-presentation", + "content": [ + "presenter-2", + "presentation" + ], + "icon": "present-mode-3.svg", + "title": "Presenter and presentation" + }, + { + "id": "presenter-presenter-2", + "content": [ + "presenter", + "presenter-2" + ], + "icon": "present-mode-3.svg", + "title": "Presenter and presentation" + } + ] + }, + "es.upv.paella.tripleVideo": { + "enabled": true, + "validContent": [ + { + "id": "presenter-presenter-2-presentation", + "content": [ + "presenter", + "presenter-2", + "presentation" + ], + "icon": "present-mode-4.svg", + "title": "Presenter and presentation" + }, + { + "id": "presenter-2-presenter-3-presentation", + "content": [ + "presenter-2", + "presenter-3", + "presentation" + ], + "icon": "present-mode-4.svg", + "title": "Presenter and presentation" + } + ] + }, + "es.upv.paella.hlsVideoFormat": { + "enabled": true, + "order": 0, + "hlsConfig": { + "maxBufferLength": 40 + }, + "corsConfig": { + "withCredentials": false, + "requestHeaders": { + "Access-Control-Allow-Credentials": false + } + } + }, + "es.upv.paella.hlsLiveVideoFormat": { + "enabled": true, + "order": 0, + "hlsConfig": { + "maxBufferLength": 40 + }, + "corsConfig": { + "withCredentials": false, + "requestHeaders": { + "Access-Control-Allow-Credentials": false + } + } + }, + "es.upv.paella.mp4VideoFormat": { + "enabled": true, + "order": 1 + }, + "es.upv.paella.audioVideoFormat": { + "enabled": true + }, + "es.upv.paella.playPauseButton": { + "enabled": true, + "order": 0, + "description": "Play and pause button" + }, + "es.upv.paella.frameControlButtonPlugin": { + "enabled": true, + "side": "right", + "order": 102 + }, + "es.upv.paella.fullscreenButton": { + "enabled": true, + "side": "right", + "order": 103 + }, + "es.upv.paella.layoutSelector": { + "enabled": true, + "side": "right", + "order": 101, + "parentContainer": "videoContainer" + }, + "es.upv.paella.playbackRateButton": { + "enabled": true, + "side": "right", + "order": 102, + "parentContainer": "videoContainer", + "rates": [ + 0.75, + 1, + 1.5, + 2 + ] + }, + "es.upv.paella.volumeButtonPlugin": { + "enabled": true, + "side": "left", + "order": 3 + }, + "es.upv.paella.forwardButtonPlugin": { + "enabled": true, + "side": "left", + "order": 2 + }, + "es.upv.paella.backwardButtonPlugin": { + "enabled": true, + "side": "left", + "order": 1 + }, + "es.upv.paella.zoomPlugin": { + "enabled": false, + "order": 0, + "maxZoom": 400, + "showButtons": true, + "target": "presenter" + }, + "es.upv.paella.videoCanvas": { + "enabled": true, + "order": 1 + }, + "es.upv.paella.audioCanvas": { + "enabled": true, + "order": 1 + }, + "es.upv.paella.cookieDataPlugin": { + "enabled": true, + "order": 0, + "context": [ + "default", + "trimming" + ] + }, + "es.upv.paella.vttManifestCaptionsPlugin": { + "enabled": false + }, + "es.upv.paella.hlsCaptionsPlugin": { + "enabled": true + }, + "es.upv.paella.captionsSelectorPlugin": { + "enabled": true, + "side": "right", + "parentContainer": "videoContainer" + }, + "es.upv.paella.qualitySelector": { + "enabled": true, + "side": "right", + "parentContainer": "videoContainer" + }, + "es.upv.paella.audioSelector": { + "enabled": true, + "side": "right" + }, + "es.upv.paella.defaultShortcuts": { + "enabled": true, + "validPlaybackRates": [ + 0.75, + 2, + 1, + 1.5 + ] + }, + "es.upv.paella.arrowSlidesNavigator": { + "enabled": true, + "target": [ + "presentation", + "presenter" + ] + }, + "es.upv.paella.keyboardShortcutsHelp": { + "enabled": true, + "order": 80, + "description": "Keyboard Shortcuts", + "side": "right" + }, + "es.upv.paella.userEventTracker": { + "enabled": true, + "context": "userTracking", + "events": [ + "PLAY", + "PAUSE", + "STOP", + "SEEK", + "BUTTON_PRESS", + "SHOW_POPUP", + "HIDE_POPUP", + "RESIZE_END", + "ENDED", + "ENTER_FULLSCREEN", + "EXIT_FULLSCREEN", + "VOLUME_CHANGED", + "CAPTIONS_ENABLED", + "CAPTIONS_DISABLED", + "LAYOUT_CHANGED", + "PLAYBACK_RATE_CHANGED", + "VIDEO_QUALITY_CHANGED" + ] + }, + "es.upv.paella.debug.userTrackingDataPlugin": { + "enabled": false, + "context": [ + "userTracking" + ] + }, + "es.upv.paella.analytics.userTrackingDataPlugin": { + "enabled": false, + "trackingId": "configure_your_tracking_id_here", + "domain": "", + "category": true, + "context": [ + "userTracking" + ] + }, + "es.upv.paella.matomo.userTrackingDataPlugin": { + "enabled": false, + "context": [ + "userTracking" + ], + "server": "//matomo.server.com/", + "siteId": "1", + "matomoGlobalLoaded": false, + "cookieType": "tracking", + "events": { + "category": "PaellaPlayer", + "action": "${event}", + "name": "${videoId}" + }, + "customDimensions": { + "1": "${videoId}" + } + }, + "es.upv.paella.slideMapProgressBarPlugin": { + "enabled": true, + "markColor": { + "mouseOut": "#0A0A0A", + "mouseHover": "#A9A9A9" + }, + "markWidth": 3, + "drawBackground": false + }, + "es.upv.paella.cookieconsent": { + "enabled": false, + "side": "right" + }, + "ch.cern.paella.liveStreamIndicatorPlugin": { + "enabled": true + }, + "ch.cern.paella.matomoAnalyticsUserTrackingPlugin": { + "enabled": true + }, + "ch.cern.paella.testButton": { + "enabled": true + }, + "ch.cern.paella.matomoAnalyticsPlugin": { + "enabled": false, + "trackingId": "126", + "domain": "https://weblecture-player.web.cern.ch", + "category": true, + "context": [ + "matomoUserTracking" + ] + }, + "ch.cern.paella.vttManifestCaptionsPlugin": { + "enabled": false, + "downloadOptions": { + "xhrFields": { + "withCredentials": true + } + }, + "crossDomain": true + }, + "ch.cern.paella.nextTimeButtonPlugin": { + "enabled": true, + "side": "right", + "order": 2 + }, + "ch.cern.paella.prevTimeButtonPlugin": { + "enabled": true, + "side": "right", + "order": 1 + }, + "es.upv.paella.findCaptionsPlugin": { + "enabled": false, + "side": "right", + "description": "Search in captions" + }, + "ch.cern.paella.liveStreamingProgressIndicator": { + "enabled": true, + "layer": "foreground", + "side": "left", + "margin": 10, + "textColor": "#AA0000", + "circleColor": "#FF0000" + } + } +} \ No newline at end of file diff --git a/repository_test/repository/test-video/data.json b/repository_test/repository/test-video/data.json new file mode 100644 index 0000000..29ebfc8 --- /dev/null +++ b/repository_test/repository/test-video/data.json @@ -0,0 +1,45 @@ +{ + "metadata": { + "duration": 909.13, + "title": "Belmar 15 minutes (multiresolution)", + "preview": "https://repository.paellaplayer.upv.es/belmar-multiresolution/preview/belmar-preview.jpg" + }, + "streams": [ + { + "sources": { + "mp4": [ + { + "src": "https://repository.paellaplayer.upv.es/belmar-multiresolution/media/720-presentation.mp4", + "mimetype": "video/mp4", + "res": { + "w": "1442", + "h": "1080" + }, + "isLiveStream": true + } + ] + }, + "preview": "https://repository.paellaplayer.upv.es/belmar-multiresolution/preview/presentation_cut.jpg", + "content": "presentation" + }, + { + "sources": { + "mp4": [ + { + "src": "https://repository.paellaplayer.upv.es/belmar-multiresolution/media/720-presenter.mp4", + "mimetype": "video/mp4", + "res": { + "w": "1920", + "h": "1080" + }, + "isLiveStream": true + } + ] + }, + "preview": "https://repository.paellaplayer.upv.es/belmar-multiresolution/preview/presenter_cut.jpg", + "content": "presenter", + "audioTag": "es" + } + ], + "frameList": [] +} \ No newline at end of file diff --git a/src/debug.js b/src/debug.js new file mode 100644 index 0000000..90641e7 --- /dev/null +++ b/src/debug.js @@ -0,0 +1,13 @@ +import { Paella } from "paella-core"; +import getCernCustomPluginsContext from "./index"; + +const initParams = { + customPluginContext: [getCernCustomPluginsContext()], +}; + +let paella = new Paella("player-container", initParams); + +paella + .loadManifest() + .then(() => console.log("done")) + .catch((e) => console.error(e)); diff --git a/src/index.html b/src/index.html new file mode 100644 index 0000000..06831e8 --- /dev/null +++ b/src/index.html @@ -0,0 +1,22 @@ + + + + + + + Document + + + +
+ + From 86f0f102ee9d5227a22b74ccc0ee124304a2ea1f Mon Sep 17 00:00:00 2001 From: Samuel Guillemet Date: Tue, 1 Aug 2023 11:42:34 +0200 Subject: [PATCH 6/6] =?UTF-8?q?=F0=9F=9A=80=20RELEASE:=20Bump=20to=20v0.1.?= =?UTF-8?q?0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 220029a..1029128 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "cern-paella-plugins", - "version": "0.0.1", + "version": "0.1.0", "description": "Paella plugins for cern use", "main": "src/index.js", "module": "dist/cern-paella-plugins.js",