Skip to content

Commit

Permalink
Merge branch 'trunk' into fix/email-styles
Browse files Browse the repository at this point in the history
  • Loading branch information
Imran92 authored Apr 23, 2024
2 parents ce2fb46 + 41752e5 commit be0c332
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 4 deletions.
4 changes: 3 additions & 1 deletion assets/js/frontend/course-video/videopress-extension.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ const initVideoPressPlayer = ( iframe ) => {

export const initVideoPressExtension = () => {
document
.querySelectorAll( '.wp-block-embed-videopress iframe' )
.querySelectorAll(
'.wp-block-embed-videopress iframe, .wp-block-jetpack-videopress iframe'
)
.forEach( initVideoPressPlayer );
};
6 changes: 4 additions & 2 deletions assets/shared/helpers/player/use-editor-player.js
Original file line number Diff line number Diff line change
Expand Up @@ -162,8 +162,10 @@ const useEditorPlayer = ( videoBlock ) => {
const doc = editorCanvasIframe?.contentDocument || document;
const w = editorCanvasIframe?.contentWindow || window;

const isJetpackVideoPress = !! videoBlock.attributes
.videoPressClassNames;
const isJetpackVideoPress =
!! videoBlock.attributes.videoPressClassNames ||
// VideoPress block (previously VideoPress used the video block).
'videopress/video' === videoBlock.name;

// Video file block.
if ( 'core/video' === videoBlock.name && ! isJetpackVideoPress ) {
Expand Down
3 changes: 3 additions & 0 deletions babel.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module.exports = {
presets: [ '@wordpress/default' ],
};
4 changes: 4 additions & 0 deletions changelog/add-new-videopress-block-support
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Significance: patch
Type: fixed

Add VideoPress block compabitility for the video settings on courses
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ public function enqueue_frontend_scripts() {
wp_add_inline_script( 'sensei-course-video-blocks-extension', $script, 'before' );

$post = get_post();
if ( has_block( 'core/video', $post ) || has_block( 'core/embed', $post ) ) {
if ( has_block( 'core/video', $post ) || has_block( 'core/embed', $post ) || has_block( 'videopress/video', $post ) ) {
Sensei()->assets->enqueue_script( 'sensei-course-video-blocks-extension' );
}
}
Expand Down
1 change: 1 addition & 0 deletions phpcs.xml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@
<properties>
<property name="custom_capabilities" type="array">
<element value="manage_sensei"/>
<element value="edit_course"/>
</property>
</properties>
</rule>
Expand Down

0 comments on commit be0c332

Please sign in to comment.