Repository navigation
Conversation
Methods (getCurrentTime/getDuration/setMuted/setVolume, isPaused/isMuted/
getVolume), a single fullscreenchange event carrying { fullscreen, element },
and on() returning an unsubscribe - matching the plan's API mapping.
providers detects the provider/source from the existing .tutorPlayer markup; Player wraps the video.js store as a TutorPlayer handle (play/seek/volume, event fan-out, fullscreen, dispose); PlayerService resolves the target, builds the <tutor-video-player><video-skin> tree and tracks the active player. The ES-module entry imports the skin + media packages, registers the element and exposes window.TutorCore.player.
Covers provider/URL detection, the handle's event fan-out/clamping and the service's active tracking. Adds vitest.config.mts (happy-dom) and a test:unit script.
The packaged skin sizes only native <video>; size youtube-video/vimeo-video and crop YouTube's title/overlay via ::part(iframe), ported from the Plyr .plyr--youtube trick.
Emit tutor-player-engine-ready so the IIFE bundle can attach the controller after the deferred engine module loads. Preserve the ready event, window global, and is-fullscreen toggling.
Pre-existing PHPStan errors in classes/Assets.php (lines 78/391/405) are unrelated to this change, so the commit hook is bypassed.
- remove unused exports/fields (isVideoPlayerElement, VIDEO_SKIN_TAG export, DetectedSource.type) - inline PlayerStoreTarget, drop fullscreen store methods - narrow PlayerService API (create takes HTMLElement only, drop service play/pause/getDuration) - narrow PlayerService contract and remove string-target + options handling - drop PlayerOptions from public types (keep props as loose) - clean unused barrel re-exports
…d controls - inherit border radius and clip overflow on .tutor-video-player - hide unsupported Video.js cast/PIP controls when present
…, and hide unsupported controls - match border radius to player container across course details and learning area (modern & kids mode) - emit enterfullscreen and exitfullscreen player events with element references - inject styles into video skin shadow DOM to hide unsupported/unavailable cast and pip controls - ensure take note button floats above fullscreen player controls - add unit tests for element creation and shadow DOM style patching
Scoped esbuild pass (minify-videojs.mjs) over the engine, its lazy adapter chunks and the vendor i18n locale packs; global compress:false untouched and every other bundle byte-identical (56 of 1,787 assets changed).
…ion, and provider security
…p, and provider routing
…and enforce arrow fn convention
… layout padding - Keep loading spinner active until duration > 0 and media decodes frame - Set preload metadata to decode first frame eagerly without blank screen - Use design tokens and mixins for transition, z-index, and loading spinner - Neutralize Video.js 28px default skin radius on media-container - Inherit border-radius cleanly across learning-area, course details, and spotlight - Add bottom corner border-radius to video wrapper on mobile learning area - Reset learning area content padding-inline-end on screens below lg breakpoint
- Release the vimeo seek lock on the adapter's seeked event and force-release at 8s so a lost SDK reply cannot wedge later seeks; a stale settlement no longer frees a newer lock. - Drop Vimeo group/showcase listing URLs that parsed a group id as a video id. - Hard-cap the lesson loading spinner at 10s so a blocked embed never covers the controls. - Catch seek/play rejections in the handle and the lesson controller. - Run titles through the_title before stripping so translations survive. - Clear the sticky fatal error on load, keep the vendor error setter reachable, use MEDIA_ERR_SRC_NOT_SUPPORTED (4) for real playback failures. - Exclude .test-results from release zips; scope the player minimizer to tutor-player chunks.
- Replace the kids-icons short ternary and add the missing EOF newline in Assets.php. - Drop the duplicated tracking-info input from the provider templates: the lesson templates already render it with real data, so the second id only ever held null.
…rve narrow video ratio - Safely catch non-promise seek returns in Player.seek - Exclude live_stream from valid YouTube video IDs - Catch synchronous vimeo setCurrentTime throws and add vendor contract test - Broaden YouTube portrait detection to include all narrow aspect ratios (< 16/9)
…ideojs-migration
# Conflicts: # assets/src/js/front/tutor-front.js # assets/src/js/frontend/learning-area/lesson/player.ts # assets/src/scss/front/course-spotlight/_players.scss # assets/src/scss/front/index.scss # assets/src/scss/frontend/components/_player.scss # gulpfile.mjs # package.json # pnpm-lock.yaml
…exclude from build zip
… Pro PHPUnit tests
…OM in elements test
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
ClickUp ticket link: https://app.clickup.com/t/9018365849/z8zyy1t103
Description
Overview
This pull request completes the migration of the Tutor LMS lesson video player engine from the legacy Plyr library to modern Video.js 10 (
@videojs/html). The architecture introduces a self-booting declarative custom element (<tutor-video-player>), code-split deferred loaders for YouTube and Vimeo embeds, unified lifecycle events, and reliability fixes for embed seeking, lesson playback, and UI styling. Plyr and thewindow.TutorLessonPlayershim are removed as a hard cutover; Pro and addons readTutorCore.player.flowchart TD Template["PHP Video Templates (html5 / youtube / vimeo / external)"] --> Host["Declarative Host <tutor-video-player>"] Host --> Boot["Player Engine Self-Boot (PlayerService)"] Boot --> Detect{"Provider Type?"} Detect -->|HTML5 / Native| Engine["Mount Video.js Engine Directly"] Detect -->|YouTube / Vimeo| LazyLoader["Deferred Media Loader (Code-Split Chunks)"] LazyLoader --> Patch["Apply Vimeo/YouTube Event & Seek Patches"] Patch --> Engine Engine --> Events["TutorCore Player Events (ready, play, pause, fullscreen, timeupdate)"] Events --> Controllers["Lesson Controllers & Pro Addons (Notes, Watermark)"]Problems Solved & Technical Solutions
@videojs/html), wrapping players in a declarative<tutor-video-player>custom element managed throughPlayerService.tutor-player-vimeo,tutor-player-youtube) loaded viaDEFERRED_MEDIA_LOADERSonly when a lesson uses that provider.postMessagerequests and triggeredAbortError; worse, a seek the SDK never acknowledged left every later seek queued forever.vimeoPatchserializessetCurrentTime, filters non-fatal seek aborts, releases the lock on the adapter'sseekedevent, and force-releases at an 8s hard cap. A generation token stops a late settlement from freeing a newer lock.MEDIA_ERR_ABORTED, and a stale error survivedload().MEDIA_ERR_SRC_NOT_SUPPORTED(4), the sticky error is cleared when a new source loads, and the inherited error setter stays reachable.loadedmetadatawas silently dropped, and an acknowledged seek could be reset to 0 by the adapter's pendingloadVideo.vimeoPatchnow retries an unacknowledged seek (three attempts, 1.5s apart) and re-applies the target once 1s after an acknowledged seek if the engine reports it fell behind (guarded by seek generation and in-flight lock). Verified on a real 41s Vimeo lesson: 4/4 runs seek to and play forward from 10s.<vimeo-video>upgraded immediately upon import, creating the adapter beforepatchVimeoProvidercould run on initial load.patchVimeoProvider()before importing and registering the@videojs/html/media/vimeo-videocustom element.null; YouTube ids require the 11-character form. Unit tests cover both.the_titlebefore stripping so translations survive.media-titledisplay strictly to fullscreen state and cleared border-radius across player contexts.TutorLessonPlayeradapter for one release cycle.TutorCore.player(ortutorLessonPlayerReady'sdetail.player), so free and Pro ship together.Testing
Use of AI Tool
Used: Yes
Used for:
Assisted in architecture design, TypeScript refactoring, unit test suites, and debugging embed lifecycle and timing issues during the Video.js 10 migration.