-
Notifications
You must be signed in to change notification settings - Fork 21
GoDAM Youzify support #1336
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
Open
KMchaudhary
wants to merge
17
commits into
develop
Choose a base branch
from
feat/youzify-support
base: develop
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
GoDAM Youzify support #1336
Changes from 16 commits
Commits
Show all changes
17 commits
Select commit
Hold shift + click to select a range
09e604b
Replace youzify videos with GoDAM video blocks on feeds pages if GoDA…
c604b15
Save the transcoded URL fetched from godam central callback request
67bdc31
remove send_transcoding_request function
10bd822
Replace audio player with GoDAM audio player
7f0e1be
Implement mutation observer on activity page, to dynamically render G…
607ca9c
Replace default video player with GoDAM video player on media page
0a15fef
Implement godam video preview popup when clicks on play button
ca0b70c
Fix the media page only scripts loading
34fd944
Add container query for video tools responsive style
2e569a1
Add mutation observer to render GoDAM player for video added by AJAX …
cdc9560
Add media page scripts on media and media/videos pages
dca17f9
Add helper function to enqueue godam player scripts and styles
e2ffc0c
Fxi the conatiner query syntax error
70ec917
Resolve copilot comments
181cd20
Remove esc button event when video modal is closed
4c56ea3
Fix the plause video on modal close for all edge cases
39ed5c3
Address copilot comments
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,196 @@ | ||
| // Video Popup Modal Styles | ||
| .godam-video-popup-modal { | ||
| position: fixed; | ||
| top: 0; | ||
| left: 0; | ||
| right: 0; | ||
| bottom: 0; | ||
| z-index: 999999; | ||
| display: flex; | ||
| align-items: center; | ||
| justify-content: center; | ||
| animation: fadeIn 0.3s ease; | ||
| } | ||
|
|
||
| .godam-video-popup-overlay { | ||
| position: absolute; | ||
| top: 0; | ||
| left: 0; | ||
| right: 0; | ||
| bottom: 0; | ||
| background: rgba(0, 0, 0, 0.85); | ||
| backdrop-filter: blur(4px); | ||
| } | ||
|
|
||
| .godam-video-popup-content { | ||
| position: relative; | ||
| width: 90%; | ||
| max-width: 880px; | ||
| max-height: 90vh; | ||
| z-index: 1; | ||
| animation: slideUp 0.3s ease; | ||
| } | ||
|
|
||
| .godam-video-popup-close { | ||
| position: absolute; | ||
| top: -40px; | ||
| right: 0; | ||
| background: rgba(255, 255, 255, 0.2); | ||
| border: none; | ||
| border-radius: 50%; | ||
| width: 36px; | ||
| height: 36px; | ||
| display: flex; | ||
| align-items: center; | ||
| justify-content: center; | ||
| cursor: pointer; | ||
| transition: all 0.2s ease; | ||
| z-index: 2; | ||
|
|
||
| svg { | ||
| width: 20px; | ||
| height: 20px; | ||
| fill: #fff; | ||
| } | ||
|
|
||
| &:hover { | ||
| background: rgba(255, 255, 255, 0.3); | ||
| transform: rotate(90deg); | ||
| } | ||
| } | ||
|
|
||
| .godam-video-popup-player { | ||
| position: relative; | ||
| width: 100%; | ||
|
|
||
| figure { | ||
| margin: 0; | ||
| } | ||
|
|
||
| .godam-video-wrapper { | ||
| width: 100%; | ||
| } | ||
| } | ||
|
|
||
| // Prevent body scroll when popup is open | ||
| body.godam-video-popup-open { | ||
| overflow: hidden; | ||
| } | ||
|
|
||
| // Animations | ||
| @keyframes fadeIn { | ||
|
|
||
| from { | ||
| opacity: 0; | ||
| } | ||
|
|
||
| to { | ||
| opacity: 1; | ||
| } | ||
| } | ||
|
|
||
| @keyframes slideUp { | ||
|
|
||
| from { | ||
| opacity: 0; | ||
| transform: translateY(30px); | ||
| } | ||
|
|
||
| to { | ||
| opacity: 1; | ||
| transform: translateY(0); | ||
| } | ||
| } | ||
|
|
||
| // Responsive adjustments | ||
| @media (max-width: 768px) { | ||
|
|
||
| .godam-video-popup-content { | ||
| width: 95%; | ||
| max-height: 80vh; | ||
| } | ||
|
|
||
| .godam-video-popup-close { | ||
| top: -35px; | ||
| width: 32px; | ||
| height: 32px; | ||
| } | ||
| } | ||
|
|
||
| // Youzify Media Item Video Styles | ||
| .youzify-media-item-godam-video { | ||
| position: relative; | ||
| container-name: youzify-media-item-godam-video; | ||
| container-type: inline-size; | ||
|
|
||
| &--tools { | ||
|
|
||
| position: absolute; | ||
| top: 0; | ||
| bottom: 0; | ||
| left: 0; | ||
| right: 0; | ||
| display: flex; | ||
| justify-content: center; | ||
| align-items: center; | ||
| gap: 10px; | ||
| z-index: 9999; | ||
|
|
||
| a { | ||
| color: #fff; | ||
| width: 45px; | ||
| height: 45px; | ||
| text-align: center; | ||
| border-radius: 100%; | ||
| background: rgba(0, 0, 0, .3); | ||
| display: inline-flex; | ||
| justify-content: center; | ||
| align-items: center; | ||
| } | ||
|
|
||
| svg { | ||
| width: 20px; | ||
| height: 20px; | ||
| fill: #fff; | ||
| } | ||
| } | ||
|
|
||
| &--play-button { | ||
| cursor: pointer; | ||
| transition: transform 0.2s ease; | ||
|
|
||
| &:hover svg { | ||
| transform: scale(1.1); | ||
| } | ||
| } | ||
|
|
||
| .video-js .vjs-control-bar { | ||
| display: none; | ||
| } | ||
|
|
||
| figure, | ||
| :where(figure) { | ||
| margin: 0 !important; | ||
| } | ||
|
|
||
| .godam-video-wrapper { | ||
|
|
||
| .vjs-big-play-button { | ||
| display: none; | ||
| } | ||
| } | ||
| } | ||
|
|
||
| @container youzify-media-item-godam-video (max-width: 120px) { | ||
|
|
||
| .youzify-media-item-godam-video--tools a { | ||
|
|
||
| width: 20px; | ||
| height: 20px; | ||
|
|
||
| svg { | ||
| width: 16px; | ||
| height: 16px; | ||
| } | ||
| } | ||
| } | ||
KMchaudhary marked this conversation as resolved.
Show resolved
Hide resolved
|
||
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,69 @@ | ||
| ( function( window, document ) { | ||
| if ( window.godamYouzifyObserverInitialized ) { | ||
| return; | ||
| } | ||
| window.godamYouzifyObserverInitialized = true; | ||
|
|
||
| const boot = function() { | ||
| const hasMutationObserver = 'MutationObserver' in window; | ||
|
|
||
| const initializePlayer = function( container ) { | ||
| if ( ! container || container.dataset.godamPlayerBootstrapped === '1' ) { | ||
| return; | ||
| } | ||
|
|
||
| const video = container.querySelector( '.easydam-player.video-js' ); | ||
| if ( ! video || typeof window.GODAMPlayer !== 'function' ) { | ||
| return; | ||
| } | ||
|
|
||
| container.dataset.godamPlayerBootstrapped = '1'; | ||
| window.GODAMPlayer( container ); | ||
| }; | ||
|
|
||
| const discoverContainers = function( root ) { | ||
| if ( ! root || typeof root.querySelectorAll !== 'function' ) { | ||
| return; | ||
| } | ||
|
|
||
| root.querySelectorAll( '.easydam-video-container' ).forEach( initializePlayer ); | ||
| }; | ||
|
|
||
| // Initialize existing containers on page load | ||
| discoverContainers( document ); | ||
|
|
||
| // If MutationObserver is not available, we've already initialized existing containers | ||
| if ( ! hasMutationObserver ) { | ||
| return; | ||
| } | ||
|
|
||
| // Watch for new containers being added to the DOM | ||
| const mutationObserver = new MutationObserver( ( mutationList ) => { | ||
| mutationList.forEach( ( mutation ) => { | ||
| mutation.addedNodes.forEach( ( node ) => { | ||
| if ( ! ( node instanceof HTMLElement ) ) { | ||
| return; | ||
| } | ||
|
|
||
| // If the added node itself is a video container, initialize it | ||
| if ( node.classList.contains( 'easydam-video-container' ) ) { | ||
| initializePlayer( node ); | ||
| } | ||
|
|
||
| // Also check for containers within the added node | ||
| discoverContainers( node ); | ||
| } ); | ||
| } ); | ||
| } ); | ||
|
|
||
| if ( document.body ) { | ||
| mutationObserver.observe( document.body, { childList: true, subtree: true } ); | ||
| } | ||
| }; | ||
|
|
||
| if ( document.readyState === 'loading' ) { | ||
| document.addEventListener( 'DOMContentLoaded', boot ); | ||
| } else { | ||
| boot(); | ||
| } | ||
| }( window, document ) ); |
Oops, something went wrong.
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.