Skip to content

Commit

Permalink
Bump video.js to 7.21.2 (latest-7) (#1251)
Browse files Browse the repository at this point in the history
* Replace videojs 7.20.3 by 7.21.2 (latest-7)
+ correct some JSDoc formats
+ Uniformize default DEBUG value to True
+ Replace some `b` HTML tag by `strong`
  • Loading branch information
Badatos authored Jan 22, 2025
1 parent fd784e2 commit 1e8c20f
Show file tree
Hide file tree
Showing 25 changed files with 228 additions and 228 deletions.
62 changes: 31 additions & 31 deletions pod/completion/static/js/caption_maker.js
Original file line number Diff line number Diff line change
Expand Up @@ -324,7 +324,7 @@ var captionBeingDisplayed = -1;

/**
* Display existing caption
* @param {[type]} seconds [description]
* @param {[type]} seconds - time in seconds
*/
function displayExistingCaption(seconds) {
var ci = findCaptionIndex(seconds);
Expand Down Expand Up @@ -360,7 +360,7 @@ function existingCaptionsEndTime() {

/**
* Update captions array.
* @param {[type]} vtt [description]
* @param {string} vtt - VTT string
*/
let updateCaptionsArray = (vtt) => {
let arr = vtt.split("\n\n");
Expand Down Expand Up @@ -665,8 +665,8 @@ let updateCaptionHtmlContent = () => {

/**
* Update caption.
* @param {[type]} ci caption index
* @param {[type]} captionText caption text
* @param {int} ci - caption index
* @param {string} captionText - caption text
*/
function updateCaption(ci, captionText) {
captionsArray[ci].caption = captionText;
Expand All @@ -677,8 +677,8 @@ let lastEditedBlock = null;

/**
* Create a caption block object.
* @param {Object} newCaption Simple object representing the caption block
* @param {Function} spawnFunction Function to call after block init
* @param {Object} newCaption - Simple object representing the caption block
* @param {Function} spawnFunction - Function to call after block init
*/
function createCaptionBlock(newCaption, spawnFunction) {
let captionText = newCaption.caption;
Expand Down Expand Up @@ -871,7 +871,7 @@ function createCaptionBlock(newCaption, spawnFunction) {

/**
* Spawn New Block
* @param {Event} e Triggered Event
* @param {Event} e - Triggered Event
*/
spawnNew: function (e) {
e.preventDefault();
Expand Down Expand Up @@ -900,7 +900,7 @@ function createCaptionBlock(newCaption, spawnFunction) {

/**
* Delete Block
* @param {Event} e Triggered Event
* @param {Event} e - Triggered Event
*/
delete: function (e) {
e.preventDefault();
Expand Down Expand Up @@ -1140,8 +1140,8 @@ editorShortcuts.init();

/**
* Add caption list row
* @param {[type]} ci [description]
* @param {[type]} newCaption [description]
* @param {int} ci - Caption index
* @param {[type]} newCaption - Caption object
*/
function addCaptionListRow(ci, newCaption) {
let vtt = document.getElementById("caption-content");
Expand All @@ -1167,9 +1167,9 @@ function addCaptionListRow(ci, newCaption) {

/**
* Add caption
* @param {[type]} captionStart [description]
* @param {[type]} captionEnd [description]
* @param {[type]} captionText [description]
* @param {[type]} captionStart - Start time
* @param {[type]} captionEnd - End time
* @param {[type]} captionText - Caption content
*/
function addCaption(captionStart, captionEnd, captionText) {
const pod = document.getElementById("podvideoplayer");
Expand All @@ -1190,8 +1190,8 @@ function addCaption(captionStart, captionEnd, captionText) {

/**
* Convert HMS time format to seconds only
* @param {string} str hms
* @return {number} corresponding seconds
* @param {string} str - hms
* @return {number} - corresponding seconds
*/
function hmsToSecondsOnly(str) {
let p = str.split(":"),
Expand All @@ -1206,7 +1206,7 @@ function hmsToSecondsOnly(str) {

/**
* Parses webvtt time string format into floating point seconds
* @param {[type]} sTime [description]
* @param {[type]} sTime - Webvtt time string
*/
function parseTime(sTime) {
let seconds = hmsToSecondsOnly(sTime);
Expand All @@ -1228,7 +1228,7 @@ function parseTime(sTime) {

/**
* formats floating point seconds into the webvtt time string format
* @param {[type]} seconds [description]
* @param {[type]} seconds - floating point seconds
*/
function formatTime(seconds) {
var hh = Math.floor(seconds / (60 * 60));
Expand All @@ -1246,7 +1246,7 @@ function formatTime(seconds) {

/**
* Find caption index
* @param {[type]} seconds [description]
* @param {[type]} seconds - Time in seconds
*/
function findCaptionIndex(seconds) {
var below = -1;
Expand All @@ -1268,7 +1268,7 @@ function findCaptionIndex(seconds) {

/**
* Play selected caption
* @param {[type]} timeline [description]
* @param {string} timeline -
*/
function playSelectedCaption(timeline) {
if (timeline.includes("-->")) {
Expand All @@ -1288,7 +1288,7 @@ function playSelectedCaption(timeline) {

/**
* Escape Html entities
* @param {string} s String to be escaped
* @param {string} s - String to be escaped
*/
function XMLEncode(s) {
return s
Expand All @@ -1302,7 +1302,7 @@ function XMLEncode(s) {

/**
* Decode Html entities
* @param {String} s String to be decoded
* @param {String} s - String to be decoded
*/
function XMLDecode(s) {
return s
Expand All @@ -1315,7 +1315,7 @@ function XMLDecode(s) {

/**
* Load caption file
* @param {[type]} fileObject [description]
* @param {[type]} fileObject - File object to be loaded
*/
/*
function loadCaptionFile(fileObject) {
Expand Down Expand Up @@ -1344,7 +1344,7 @@ function loadCaptionFile(fileObject) {

/**
* Invoked by script insertion of proxyvtt.ashx
* @param {[type]} obj [description]
* @param {[type]} obj -
*/
function processProxyVttResponse(obj) {
obj = JSON.parse(obj);
Expand Down Expand Up @@ -1376,7 +1376,7 @@ function processProxyVttResponse(obj) {

/**
* Partial parser for WebVTT files based on the spec at http://dev.w3.org/html5/webvtt/
* @param {[type]} vtt [description]
* @param {[type]} vtt - VTT file content
*/
function parseAndLoadWebVTT(vtt) {
var vttLines = vtt.split(/\r\n|\r|\n/); // create an array of lines from our file
Expand Down Expand Up @@ -1460,8 +1460,8 @@ const registerPlugin = videojs.registerPlugin || videojs.plugin;

/**
* On player ready Event
* @param {[type]} player [description]
* @param {[type]} options [description]
* @param {[type]} player - Video player
* @param {[type]} options - Options (not used ?)
*/
const onPlayerReady = function (player, options) {
let startKeyframe;
Expand All @@ -1483,8 +1483,8 @@ const onPlayerReady = function (player, options) {

/**
* Highlight video region
* @param {[type]} startTime [description]
* @param {[type]} endTime [description]
* @param {[type]} startTime - Start time in seconds
* @param {[type]} endTime - End time in seconds
*/
highlightVideoRegion = function (startTime, endTime) {
clearVideoRegion();
Expand Down Expand Up @@ -1520,7 +1520,7 @@ const onPlayerReady = function (player, options) {

/**
* Seek video player to absolute `time`.
* @param {[type]} time [description]
* @param {[type]} time - absolute time target
*/
function seekVideoTo(time) {
player.userActive(true);
Expand All @@ -1529,7 +1529,7 @@ function seekVideoTo(time) {

/**
* Seek video player to relative `time`.
* @param {[type]} time [description]
* @param {[type]} time - relative time target
*/
function seekVideo(time) {
player.userActive(true);
Expand All @@ -1538,7 +1538,7 @@ function seekVideo(time) {

/**
* Timeline regions
* @param {[type]} options [description]
* @param {[type]} options - Video player options
*/
function timelineRegions(options) {
this.ready(function () {
Expand Down
10 changes: 5 additions & 5 deletions pod/completion/static/js/completion.js
Original file line number Diff line number Diff line change
Expand Up @@ -85,11 +85,11 @@ document.addEventListener("submit", (e) => {
/**
* Send and get form.
*
* @param elt {HTMLElement} HTML element.
* @param action {string} Action.
* @param name {string} Name.
* @param form {string} Form.
* @param list {string} List.
* @param {HTMLElement} elt - HTML element.
* @param {string} action - Action.
* @param {string} name - Name.
* @param {string} form - Form.
* @param {string} list - List.
*
* @return {Promise<void>} The form promise.
*/
Expand Down
2 changes: 1 addition & 1 deletion pod/enrichment/static/js/videojs-slides.js
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@ var VideoSlides = function (items) {
/**
* slideShow function to show the current slide according to the time.
*
* @param {number} time the current video time
* @param {number} time - the current video time
* @return {void} doesn't return anything
* @function slideShow
*/
Expand Down
2 changes: 1 addition & 1 deletion pod/live/management/commands/checkLiveStartStop.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
)

DEFAULT_EVENT_PATH = getattr(settings, "DEFAULT_EVENT_PATH", "")
DEBUG = getattr(settings, "DEBUG", "")
DEBUG = getattr(settings, "DEBUG", True)
TIME_ZONE = getattr(settings, "TIME_ZONE", "Europe/Paris")


Expand Down
4 changes: 2 additions & 2 deletions pod/main/static/js/admin.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ const fieldHtml = document.getElementsByClassName("field-html")[0];
/**
* Function for show field.
*
* @param {HTMLElement} field The field to show.
* @param {HTMLElement} field - The field to show.
*/
function showField(field) {
field.classList.remove("d-none");
Expand All @@ -23,7 +23,7 @@ function showField(field) {
/**
* Function for hide field.
*
* @param {HTMLElement} field The field to hide.
* @param {HTMLElement} field - The field to hide.
*/
function hideField(field) {
field.classList.remove("d-block");
Expand Down
4 changes: 2 additions & 2 deletions pod/main/static/js/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ Utils.prototype = {
constructor: Utils,
/**
* Check if element is partial/fully in screen view
* @param element {HTMLElement} element to check
* @param fullyInView {Boolean} check full in view
* @param {HTMLElement} element - element to check
* @param {Boolean} fullyInView - check full in view
**/
isElementInView: function (element, fullyInView) {
const pageTop = $(window).scrollTop();
Expand Down
10 changes: 5 additions & 5 deletions pod/meeting/static/js/my_meetings.js
Original file line number Diff line number Diff line change
Expand Up @@ -93,18 +93,18 @@ meetingModal.addEventListener("show.bs.modal", function (event) {
/* TODO: check if level parameter can be removed. */
/**
* Recursively generate an HTML unordered list version of data
* @param {Array} data Data to be displayed
* @param {Number} level level of recursion (useless?)
* @return {string} Generated HTML
* @param {Array} data - Data to be displayed
* @param {Number} level - level of recursion (useless?)
* @return {string} Generated HTML
*/
function generateHtml(data, level = 0) {
let html = "<ul>";
for (let k in data) {
if (typeof data[k] === "object") {
html +=
"<li><b>" + k + ":</b> " + generateHtml(data[k], level++) + "</li>";
"<li><strong>" + k + ":</strong> " + generateHtml(data[k], level++) + "</li>";
} else {
html += "<li><b>" + k + ":</b> " + data[k] + "</li>";
html += "<li><strong>" + k + ":</strong> " + data[k] + "</li>";
}
}
html += "</ul>";
Expand Down
2 changes: 1 addition & 1 deletion pod/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"jquery-ui-dist": "^1.13.2",
"js-cookie": "^3.0.5",
"spark-md5": "^3.0.2",
"video.js": "7.20.3",
"video.js": "latest-7",
"videojs-contrib-quality-levels": "^3.0.0",
"videojs-hls-quality-selector": "^1.1.4",
"videojs-overlay": "^3.1.0",
Expand Down
6 changes: 3 additions & 3 deletions pod/playlist/static/playlist/js/add-or-edit.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
/**
* Hide or show the password field. If it is show, it is required.
*
* @param {boolean} toHide For hide the field, set to `true`.
* @param {boolean} toHide - To hide the field, set to `true`.
*/
function hidePasswordField(toHide) {
if (toHide) {
Expand All @@ -22,8 +22,8 @@ function hidePasswordField(toHide) {
/**
* Update the visibility for the help text.
*
* @param {string} visibility The new visibility.
* @param {HTMLElement} helpText The help text element.
* @param {string} visibility - The new visibility.
* @param {HTMLElement} helpText - The help text element.
*/
function updateVisibilityHelpText(visibility, helpText) {
if (visibility == 'public') {
Expand Down
8 changes: 4 additions & 4 deletions pod/playlist/static/playlist/js/playlist-player.js
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ function switchToNextVideo() {
/**
* Update the URL without refresh the page.
*
* @param {string} newUrl The new URL.
* @param {string} newUrl - The new URL.
*/
function updateUrl(newUrl) {
history.pushState({}, document.title, newUrl);
Expand All @@ -141,8 +141,8 @@ function updateUrl(newUrl) {
/**
* Refresh element with the DocumentFragment.
*
* @param {string} elementQuerySelector The query selector for the element.
* @param {*} html The html code.
* @param {string} elementQuerySelector - The query selector for the element.
* @param {*} html - The html code.
*/
function refreshElementWithDocumentFragment(elementQuerySelector, newHTMLContent) {
const fragment = document.createDocumentFragment();
Expand Down Expand Up @@ -188,7 +188,7 @@ function asyncStartCountDown() {
/**
* Start the count down.
*
* @param {function} callback The call back function.
* @param {function} callback - The call back function.
*/
function startCountdown(callback) {
countdownElement.textContent = playlistCount;
Expand Down
Loading

0 comments on commit 1e8c20f

Please sign in to comment.