Skip to content

v3.0 upgrade#457

Merged
rafa8626 merged 63 commits intomasterfrom
version-3.0
Mar 6, 2026
Merged

v3.0 upgrade#457
rafa8626 merged 63 commits intomasterfrom
version-3.0

Conversation

@rafa8626
Copy link
Copy Markdown
Member

@rafa8626 rafa8626 commented Mar 6, 2026

Summary

This PR is a complete architectural rewrite of OpenPlayerJS.

Most relevant changes

  • The v2 "mega-player" has been
    replaced by a small, composable core with optional packages layered on top — giving you
    full control over what lands in your bundle.
  • Google IMA SDK has been replaced by using Dailymotion's libraries
  • Removed injection of scripts for engines like Hls (dropped support for Dash and Flv not considered due their lack of native support on browsers)
  • New way to create plugins and media engines that increases security overall

Testing

From 47% of coverage, this version has increased to 80% or more, putting more emphasis on branch coverage

- split responsibilities into separate areas to create different bundles in the near future
- removed old bundler packages to use modern bundler (rollup)
- unit test suite upgrading replacing old one with Jest/JSDOM, and increased coverage to ~80%
- replaced IMA SDK with @dailymotion/vast-client and @dailymotion/vmap libraries
- prepared HLS.js bundle to be a separate element to load
- modified UMD files to prepare them for future addition of media engines and plugins
- added new event manager to unify events among player => engines => controls
- Upgraded ESLint and configuration, as well as installed new plugins/parsers to enhance code quality
- Fixed issue with controls not being rendered for audio tag
- Added new `main` area to add elements, to comply with what old player already supports
- Added new configuration file to extract default values that could be reused
- Switched parameters in method to avoid setting main layer in audio media
- Added default configuration and integrated it inside controls, play button and core
- Added `datetime` attribute to current time and duration controls
- Added new workflow in duration control for Live streaming
- Added accessor for media engine to access custom methods
- Cleaned up CSS stylesheet
- Integrated Ad events to be dispatched by player.on method
- Fixed workflow when using keyboard for video and audio
- Created time control for backward compatibility
- Fixed unit tests after changes
…functionality

- Unified flag to use ads with or without custom player, unified way to set ad sources, and fixed unit tests related to ads after changes
- Cleaned up unit tests that had useless/dead code introduced for the sake of increasing coverage
- Fixed issues with ads not rendering skip ads
- Added new destroy method for UI and events
- Added new event to check when controls change to dispatch new effects
- Revamped core destroy
- Added core methods to add captions, elements, controls and ads
- Updated styles for VTT cues to adapt properly to control bar visibility
- Added sanitization of XML content and some parts of code where pure text was required to avoid XSS injections
- Fixed behaviors of progress bar on mobile devices
…fixes

- Add flag for Jest command to avoid issues when committing files that don't have unit tests attached too them
- Added new workflow to check if media can be autoplayed, and split responsibilities between core and ui
- Revisited events/state layers and simplified them for future development relying on few new commands and HTML5 media events
- Clamp volume to [0..1] to avoid passing that threshold
- Removed SIMID support for now and enhanced ad setup to consider the preload="auto"/autoplay attributes coming from main media to dispatch ads
- Fixed issues with complex VMAP elements (such as pre-roll + bump/bump + mid-rolls + bump/bump + post-roll)
- Added more secure cleaning of Ads content to avoid XSS attacks
- Better TS typing in many files
- Fixed issue with Settings control to be re-rendered if ads play first
- Removed duplicity of play() calls that were unnecessary
- Fixed failing unit tests after changes
…eanup

- Added new layer to dispose all events from various layers when invoking destroy()
- Removed as many `any` types as possible and assigned proper types
- Removed `aria-label` in all places in favor of hidden spans for better accessibility with screen readers
- Added new configuration for ads to render companions outside of player
- Fixed issue with ads plugin not being able to render 2 or more skippable ads
- Updated unit tests, specially adding more robust cases when dealing with URL samples
- Added support to pause media when clicking on the main area
- Changed his.js bundle name to make it more explicit
- Moved labels object inside configuration file
- Split all src folder into packages with each one containing its own `tsconfig` file, `README` documentation and related unit tests
- Deprecated CHANGELOG in favor of new one (coming up)
- Expanded UMD bundle to add missing methods supported in older version
- Fixed multiple issues across code when media preload is set to `none` or `metadata`
- Fixed issues when using player.load() and not rendering new source
- Added new GitHub action to check for lint errors as part of coding standards
- Fixed issues with non-linear ads being treated as VAST files
- Added missing header in unit tests
- Removed unnecessary comments
- Fixed unit test inherently wrong related to ad samples
- Removed duplicated files left in previous iterations
- Added more paths to ignore in Jest configuration
- Initial pass in documentation for new features in v3 and migration docs
- Modified package.json files to prepare them to send files without src ones
- Removed `peerDependenciesMeta` element not needed in package files
- Modified `build:css` command to set the stylesheet inside package/ui to avoid broken package
- Modified main README to include links to other packages' README files and main info about new version
- Include code snippets and main migration guide from v2 to v3
- Added workflow to add custom ads methods in UMD player
- Added new cookbook with more references and samples
- Added support to embed methods from ads inside main player in UMD files
- Cleaned up types in some unit tests files
- Added new tsconfig file to serve as base for existing ones
- Added dedicated tsconfig and modified file to create types without having dependency issues with aliased imports
- Added new tsconfig file for Rollup operations, and enabled minification only on UMD files
- Modified tsconfig and package files per package to generate dist folder correctly
- Fixed regression issue with ads current time not in sync with countdown
…ocumentation

- Added default config for UMD ads file to always use custom controls and avoid issues
- Renamed package `ui` to `player`
- Renamed file `core/player` to `core/index`, as well as its class across the platform (`Player` to `Core`) for better readability
- Added release-it + turbo + pnpm to manage multi-deployment in mono repository, with scripts to customize the CHANGELOG file if needed
- Removed `docs` folder by merging documentation inside each package, and refined migration files
rafa8626 and others added 19 commits March 2, 2026 13:36
…l configuration; added flag to other commands
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Moved per-package compilerOptions into tsconfig.build.json using TS 5.5 ${configDir} keeping each package's unique references/include
- Removed .release-it.changelog.cjs and scripts/init-release-notes.mjs not needed
- Fixed eslint.config.mjs by removing drop non-existent tsconfig.types.json reference and prettier rules duplicated from .prettierrc
- Fixed typo in Jest configuration (@openplayerjs/ui -> @openplayerjs/player)
- Fixed stale @openplayer/ui references in player README and source comments
…nal parameter for controls factories and better documentation

- Renamed bundles to remove `.umd` from their names
- Fixed issue with calling non-existent stylesheet in documentation
- Added better documentation related to how to use `buildControls` method and fixed code snippets
- Added optional argument when using `createXXControl()` methods to override their placement
- Fixed issue with non-linear ads not playing along with main media
- Added links to all CodePens available for v3
…for preload/autoplay policies, and controls/UI fixes

- Added support for sources in preload to use breaks correctly
- Fixed issue with non-linear ads not allowing media to be played using only Core
- Fixed way to resume media in any circumstance after ad finishes playing
- Removed autoplay policy that considered preload="auto" as a way to autoplay
- Removed unnecessary volume/muted setters that caused wrong behaviors when attempting to autoplay
- Fixed way to use registerControl by allowing null value for factory to auto install default controls
- Added missing event for volume control to set controls depending on the muted/volume on media
- Fixed control styles to have proper space between controls depending on layers
- Added support for `layers` and `alwaysVisible` elements
- Added default controls configuration in UMD to avoid setting them all the time
- Added paragraph in Code Samples section for better readability
…r UMD, refactor controls.layers implementation and last minor fixes

- Moved implementation of control layers and alwaysShow flag in ESM to be available for both ESM and UMD
- Added currentTime, duration, src, volume, muted and playbackRate getters/setters
- Updated unit tests by cleaning up TS types
- Fixed issues with import in ads test files not found
- Upgraded packages to latest versions
…bscriptions per instance, instead of globally
rafa8626 added 2 commits March 6, 2026 09:12
- Added conditional to avoid autohiding controls when media is paused or ended
- Adjusted CSS styles for control bar to avoid conflicts between ads media
- Removed adjustment for ads countdown not showing the proper UI
- Added element in ads sanitizer to increase security when treating all executable or dangerous schemes
- Updated CONTRIBUTING guidelines to be more in tune with new version
@rafa8626 rafa8626 changed the title chore: v3.0 upgrade v3.0 upgrade Mar 6, 2026
rafa8626 added 5 commits March 6, 2026 09:20
- Updated CONTRIBUTING guidelines to indicate how to create new packages
- Disabled body max length for commits
- Added new commit-msg hook to run commitlint when attempting to commit in the repository to enforce guidelines
- Added new GitHub Action to enforce package naming conventions
- Replaced GitHub Action with a direct commitlint call to dispatch it from v3.0.0-alpha.0 and going forward
- Added new hook that runs commitlint on the exact range being pushed before the network call happens
@rafa8626 rafa8626 merged commit 7268d8d into master Mar 6, 2026
13 checks passed
@rafa8626 rafa8626 deleted the version-3.0 branch March 6, 2026 16:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants