-
Notifications
You must be signed in to change notification settings - Fork 45
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[FEATURE] Integrate media player from slub_web_sachsendigital #1320
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
CodeQL found more than 20 potential problems in the proposed changes. Check the Files changed tab for more details.
You placed a lot of JavaScript files in Also, please put all unchanged third-party libraries in their own sub-directories separate from your own JS files. There are several reasons for that:
|
f8e7a39
to
b591463
Compare
This is correct and was done on purpose. All the files in the |
As far as i know this two third-party files were copied from the original repository and rewritten by @dvoracek-slub to meet the ES6 typescript requirements: The only other file I found is: Which in my opinion should not easily be updated, like the other two files, without deeply testing the whole function of the Player. Apart from that, all other third-party dependencies are located in the |
I agree that the files created after the build process should be stored in the |
Based upon commit slub/slub_web_sachsendigital#6e68a11
- Adopt build system from `slub_web_sachsendigital` - Use player in plugin - In Table of Contents, link to timecodes - Make element ID configurable
…or retrieving timecode and file IDs
… entryArray as in Master Branch
… function on MarkerTable
…ata to add timecode and fps
…ions in webpack.config Updated the regular expression in the webpack configuration to ensure that both .css and .less file extensions are correctly anchored at the end of the string. This prevents misleading operator precedence and ensures only the intended files are processed.
…s in MediaPlayerController
- Updated .babelrc to include module-resolver plugin for alias imports. - Modified webpack.config.js to resolve alias paths for cleaner imports. - Update ESLint configuration for improved import resolution and compatibility This change improves the readability and maintainability of import statements by allowing the use of path aliases.
Codacy warning about usage of chr()
fix warning in webpack build: Skipped data-uri embedding of images/xxx.svg because file not found
Replaced PageRenderer with AssetCollector in MediaPlayerController.php for adding CSS and JavaScript assets - Feature TYPO3 v10.3: https://docs.typo3.org/c/typo3/cms-core/main/en-us/Changelog/10.3/Feature-90522-IntroduceAssetCollector.html#changelog-Feature-90522-IntroduceAssetCollector
78a41f1
to
d51c11c
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some general remarks in addition to the detailed comments below (as discussed in our call):
- Please remove the DevServer or make it a dev-only dependency if that's possible.
- Please try to merge DlfMediaPlayer, SlubMediaPlayer and lib/ as much as possible, since those are dependencies of each other anyway which won't work as stand-alone implementations.
** At the moment it is really difficult to tell apart what those do, where they are used and how they depend on each other.
** The best way of handling this would be to have just two directories: One containing the third-party Shaka player (and possibly other unchanged third-party libraries) and one containing all the Kitodo-specific code. - Please add license and author information to every non-third-party file.
/Build/Test/.env | ||
composer.lock |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please don't ignore the composer.lock
! We want to deliver a known working state of dependencies.
composer.lock |
@@ -435,6 +435,7 @@ private function getFiles(array &$details, ?SimpleXMLElement $filePointers): voi | |||
// Check if file has valid @USE attribute. | |||
if (!empty($fileUse[$fileId])) { | |||
$details['files'][$fileUse[$fileId]] = $fileId; | |||
$details['all_files'][$fileUse[$fileId]][] = $fileId; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this is highly confusing. Also, $details['files']
not being an array holding multiple file identifiers may be a bug.
I'd prefer adapting $details['files']
to hold all file identifiers instead of introducing a confusing new variable with just a slightly different use case. What do you think?
@@ -1468,6 +1530,7 @@ private function getFileRepresentation(string $id, SimpleXMLElement $physicalNod | |||
// Check if file has valid @USE attribute. | |||
if (!empty($fileUse[$fileId])) { | |||
$this->physicalStructureInfo[$id]['files'][$fileUse[$fileId]] = $fileId; | |||
$this->physicalStructureInfo[$id]['all_files'][$fileUse[$fileId]][] = $fileId; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See above. I'd prefer adapting files
instead of introducing all_files
.
|
||
$localizationFactory = GeneralUtility::makeInstance(LocalizationFactory::class); | ||
|
||
// TODO: Wouldn't there be a TypoScript utility? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please have a look at https://docs.typo3.org/other/typo3/view-helper-reference/main/en-us/Global/Translate.html
It's not recommended to implement your own translation function, try to instead use one provided by the TYPO3 framework.
<label>LLL:EXT:dlf/Resources/Private/Language/locallang_be.xlf:plugins.tableofcontents.flexform.showFull</label> | ||
<config> | ||
<type>check</type> | ||
<default>0</default> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The default here should definitely be 1
in order to keep the current behavior! Please also make sure that this is the default in TableOfContentsController
if the option was not set at all (i. e. after upgrading).
// Manual IIR filter | ||
// https://www.earlevel.com/main/2016/12/01/evaluating-filter-frequency-response/ | ||
for (let i = 0; i < this.frequencies_.length; i++) { | ||
const f = /** @type {number} */(this.frequencies_[i]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
const f = /** @type {number} */(this.frequencies_[i]) | |
const f = /** @type {number} */(this.frequencies_[i]); |
// midGain = 10 * Math.log10(1 + (baseBoost / freq) ** 2) - 10 * Math.log10(1 + (baseBoostRolloff / freq) ** 2) | ||
// midGain / 10 = Math.log10(1 + (baseBoost / freq) ** 2) - Math.log10(1 + (baseBoostRolloff / freq) ** 2) | ||
// midGain / 10 = Math.log10((1 + (baseBoost / freq) ** 2) / (1 + (baseBoostRolloff / freq) ** 2)) | ||
// 10 ^ (midGain / 10) = (1 + (baseBoost / freq) ** 2) / (1 + (baseBoostRolloff / freq) ** 2) | ||
|
||
// 10 ^ (((10 * Math.log10(1 + baseBoost ** 2) - 10 * Math.log10(1 + baseBoostRolloff ** 2)) / 2) / 10) = (1 + (baseBoost / freq) ** 2) / (1 + (baseBoostRolloff / freq) ** 2) | ||
// 10 ^ ((Math.log10((1 + baseBoost ** 2) / (1 + baseBoostRolloff ** 2))) / 2) = (1 + (baseBoost / freq) ** 2) / (1 + (baseBoostRolloff / freq) ** 2) | ||
// sqrt((1 + baseBoost ** 2) / (1 + baseBoostRolloff ** 2)) = (1 + (baseBoost / freq) ** 2) / (1 + (baseBoostRolloff / freq) ** 2) | ||
|
||
// For midFreq, ask Wolfram Alpha to solve |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
?
@@ -0,0 +1,8 @@ | |||
@import "../../../../slub_digitalcollections/Resources/Private/Less/Helper/Variables.less"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please don't add dependencies to slub_digitalcollections
!
'fileGrpVideo' => 'VIDEO,DEFAULT', | ||
'fileGrpVideo' => 'VIDEO,DEFAULT,VIDEO_ALT1', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Duplicate use of the array key fileGrpVideo
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please remove this file.
This PR integrates the video/audio player from slub_web_sachsendigital into a new MediaPlayer plugin.
The PR is based on #796 and #818 from @dvoracek-slub