Skip to content

Commit

Permalink
fix videotools subtitle timeline
Browse files Browse the repository at this point in the history
  • Loading branch information
aynsix committed Oct 24, 2023
1 parent fc3baaf commit 326b353
Show file tree
Hide file tree
Showing 9 changed files with 25 additions and 22 deletions.
2 changes: 1 addition & 1 deletion Phraseanet-production-client/config/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,5 @@ module.exports = {
setupDir: _root + 'tests/setup/node.js',
karmaConf: _root + 'config/karma.conf.js',
// change this version when you change JS file for lazy loading
assetFileVersion: 95
assetFileVersion: 96
};
2 changes: 1 addition & 1 deletion Phraseanet-production-client/dist/authenticate.js
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ return /******/ (function(modules) { // webpackBootstrap
/******/ if (__webpack_require__.nc) {
/******/ script.setAttribute("nonce", __webpack_require__.nc);
/******/ }
/******/ script.src = __webpack_require__.p + "lazy-" + ({}[chunkId]||chunkId) + ".js?v=95";
/******/ script.src = __webpack_require__.p + "lazy-" + ({}[chunkId]||chunkId) + ".js?v=96";
/******/ var timeout = setTimeout(onScriptComplete, 120000);
/******/ script.onerror = script.onload = onScriptComplete;
/******/ function onScriptComplete() {
Expand Down
2 changes: 1 addition & 1 deletion Phraseanet-production-client/dist/authenticate.min.js
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ return /******/ (function(modules) { // webpackBootstrap
/******/ if (__webpack_require__.nc) {
/******/ script.setAttribute("nonce", __webpack_require__.nc);
/******/ }
/******/ script.src = __webpack_require__.p + "lazy-" + ({}[chunkId]||chunkId) + ".min.js?v=95";
/******/ script.src = __webpack_require__.p + "lazy-" + ({}[chunkId]||chunkId) + ".min.js?v=96";
/******/ var timeout = setTimeout(onScriptComplete, 120000);
/******/ script.onerror = script.onload = onScriptComplete;
/******/ function onScriptComplete() {
Expand Down
2 changes: 1 addition & 1 deletion Phraseanet-production-client/dist/commons.js
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@
/******/ if (__webpack_require__.nc) {
/******/ script.setAttribute("nonce", __webpack_require__.nc);
/******/ }
/******/ script.src = __webpack_require__.p + "lazy-" + ({}[chunkId]||chunkId) + ".js?v=95";
/******/ script.src = __webpack_require__.p + "lazy-" + ({}[chunkId]||chunkId) + ".js?v=96";
/******/ var timeout = setTimeout(onScriptComplete, 120000);
/******/ script.onerror = script.onload = onScriptComplete;
/******/ function onScriptComplete() {
Expand Down
2 changes: 1 addition & 1 deletion Phraseanet-production-client/dist/commons.min.js
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@
/******/ if (__webpack_require__.nc) {
/******/ script.setAttribute("nonce", __webpack_require__.nc);
/******/ }
/******/ script.src = __webpack_require__.p + "lazy-" + ({}[chunkId]||chunkId) + ".min.js?v=95";
/******/ script.src = __webpack_require__.p + "lazy-" + ({}[chunkId]||chunkId) + ".min.js?v=96";
/******/ var timeout = setTimeout(onScriptComplete, 120000);
/******/ script.onerror = script.onload = onScriptComplete;
/******/ function onScriptComplete() {
Expand Down
11 changes: 6 additions & 5 deletions Phraseanet-production-client/dist/production.js
Original file line number Diff line number Diff line change
Expand Up @@ -64612,7 +64612,7 @@ var videoSubtitleCapture = function videoSubtitleCapture(services, datas) {
minutes = minutes < 10 ? "0" + minutes : minutes;
seconds = seconds < 10 ? "0" + seconds : seconds;
// if(isNaN(hours) && isNaN(minutes) && isNaN(seconds) && isNaN(milliseconds) ) {
return hours + ":" + minutes + ":" + seconds + "." + milliseconds;
return hours + ":" + minutes + ":" + seconds + "." + ('000' + milliseconds).slice(-3);
//}
}

Expand Down Expand Up @@ -64649,11 +64649,14 @@ var videoSubtitleCapture = function videoSubtitleCapture(services, datas) {
var captionText = "WEBVTT - with cue identifier\n\n";
while (i <= countSubtitle * 3) {
j = j + 1;
captionText += j + "\n" + allData[i].value + " --> " + allData[i + 1].value + "\n" + allData[i + 2].value + "\n\n";
// save only wich with value not empty
if (allData[i + 2].value.length != 0) {
captionText += j + "\n" + allData[i].value + " --> " + allData[i + 1].value + "\n" + allData[i + 2].value + "\n\n";
}

i = i + 3;
if (i == countSubtitle * 3 - 3) {
(0, _jquery2.default)('#record-vtt').val(captionText);
console.log(captionText);
if (btn == 'save') {
//send data
_jquery2.default.ajax({
Expand Down Expand Up @@ -64758,7 +64761,6 @@ var videoSubtitleCapture = function videoSubtitleCapture(services, datas) {
ResValue = fieldvalue.split("WEBVTT - with cue identifier\n\n");
captionValue = ResValue[1].split("\n\n");
captionLength = captionValue.length;
console.log(captionValue);
for (var i = 0; i <= captionLength - 1; i++) {

// Regex blank line
Expand Down Expand Up @@ -64860,7 +64862,6 @@ var videoSubtitleCapture = function videoSubtitleCapture(services, datas) {
try {
var requestData = (0, _jquery2.default)('#video-subtitle-request').serializeArray();
requestData = JSON.parse(JSON.stringify(requestData));
console.log(requestData);
} catch (err) {
return;
}
Expand Down
11 changes: 6 additions & 5 deletions Phraseanet-production-client/dist/production.min.js
Original file line number Diff line number Diff line change
Expand Up @@ -64612,7 +64612,7 @@ var videoSubtitleCapture = function videoSubtitleCapture(services, datas) {
minutes = minutes < 10 ? "0" + minutes : minutes;
seconds = seconds < 10 ? "0" + seconds : seconds;
// if(isNaN(hours) && isNaN(minutes) && isNaN(seconds) && isNaN(milliseconds) ) {
return hours + ":" + minutes + ":" + seconds + "." + milliseconds;
return hours + ":" + minutes + ":" + seconds + "." + ('000' + milliseconds).slice(-3);
//}
}

Expand Down Expand Up @@ -64649,11 +64649,14 @@ var videoSubtitleCapture = function videoSubtitleCapture(services, datas) {
var captionText = "WEBVTT - with cue identifier\n\n";
while (i <= countSubtitle * 3) {
j = j + 1;
captionText += j + "\n" + allData[i].value + " --> " + allData[i + 1].value + "\n" + allData[i + 2].value + "\n\n";
// save only wich with value not empty
if (allData[i + 2].value.length != 0) {
captionText += j + "\n" + allData[i].value + " --> " + allData[i + 1].value + "\n" + allData[i + 2].value + "\n\n";
}

i = i + 3;
if (i == countSubtitle * 3 - 3) {
(0, _jquery2.default)('#record-vtt').val(captionText);
console.log(captionText);
if (btn == 'save') {
//send data
_jquery2.default.ajax({
Expand Down Expand Up @@ -64758,7 +64761,6 @@ var videoSubtitleCapture = function videoSubtitleCapture(services, datas) {
ResValue = fieldvalue.split("WEBVTT - with cue identifier\n\n");
captionValue = ResValue[1].split("\n\n");
captionLength = captionValue.length;
console.log(captionValue);
for (var i = 0; i <= captionLength - 1; i++) {

// Regex blank line
Expand Down Expand Up @@ -64860,7 +64862,6 @@ var videoSubtitleCapture = function videoSubtitleCapture(services, datas) {
try {
var requestData = (0, _jquery2.default)('#video-subtitle-request').serializeArray();
requestData = JSON.parse(JSON.stringify(requestData));
console.log(requestData);
} catch (err) {
return;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ const videoSubtitleCapture = (services, datas, activeTab = false) => {
minutes = (minutes < 10) ? "0" + minutes : minutes;
seconds = (seconds < 10) ? "0" + seconds : seconds;
// if(isNaN(hours) && isNaN(minutes) && isNaN(seconds) && isNaN(milliseconds) ) {
return hours + ":" + minutes + ":" + seconds + "." + milliseconds;
return hours + ":" + minutes + ":" + seconds + "." + ('000' + milliseconds).slice(-3);
//}

}
Expand Down Expand Up @@ -172,11 +172,14 @@ const videoSubtitleCapture = (services, datas, activeTab = false) => {
var captionText = "WEBVTT - with cue identifier\n\n";
while (i <= countSubtitle * 3) {
j= j +1;
captionText += j + "\n" + allData[i].value + " --> " + allData[i + 1].value + "\n" + allData[i + 2].value + "\n\n";
// save only wich with value not empty
if (allData[i + 2].value.length != 0) {
captionText += j + "\n" + allData[i].value + " --> " + allData[i + 1].value + "\n" + allData[i + 2].value + "\n\n";
}

i = i + 3;
if (i == (countSubtitle * 3) - 3) {
$('#record-vtt').val(captionText);
console.log(captionText);
if (btn == 'save') {
//send data
$.ajax({
Expand Down Expand Up @@ -286,7 +289,6 @@ const videoSubtitleCapture = (services, datas, activeTab = false) => {
ResValue = fieldvalue.split("WEBVTT - with cue identifier\n\n");
captionValue = ResValue[1].split("\n\n");
captionLength = captionValue.length;
console.log(captionValue);
for (var i = 0; i <= captionLength - 1; i++) {

// Regex blank line
Expand Down Expand Up @@ -317,7 +319,7 @@ const videoSubtitleCapture = (services, datas, activeTab = false) => {

startVal = stringToseconde(timeValue[0]);
//Re-Build EndTime
timeValue = timeValue [1].split("\n")
timeValue = timeValue[1].split("\n")
$('.item_' + i + ' .video-subtitle-item ').closest('.editing').find('.end-label').text(timeValue[0]);
$('.item_' + i + ' .video-subtitle-item ').find('.endTime').val(timeValue[0]);
endVal = stringToseconde(timeValue[0]);
Expand Down Expand Up @@ -393,7 +395,6 @@ const videoSubtitleCapture = (services, datas, activeTab = false) => {
try {
var requestData = $('#video-subtitle-request').serializeArray();
requestData = JSON.parse(JSON.stringify(requestData));
console.log(requestData)

} catch (err) {
return;
Expand Down
2 changes: 1 addition & 1 deletion lib/Alchemy/Phrasea/Twig/PhraseanetExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ public function getGlobals()
{
return [
// change this version when you change JS file to force the navigation to reload js file
'assetFileVersion' => 95
'assetFileVersion' => 96
];

}
Expand Down

0 comments on commit 326b353

Please sign in to comment.