Skip to content
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

Add Video Layers on Frontend #14

Merged
merged 10 commits into from
Dec 18, 2024
Merged

Add Video Layers on Frontend #14

merged 10 commits into from
Dec 18, 2024

Conversation

subodhr258
Copy link
Collaborator

This PR adds the following features:

  • Used render.php to display the video and gravityform shortcodes on the frontend
  • Displayed the Form/CTA over the video at the specified Display Time
  • When the form is submitted, added an observer to change "Skip" to "Continue"
  • Disallowed user from bypassing the overlay by temporarily hiding controls
  • When "allow_skip" value is false, the Skip button is hidden, and becomes visible as "Continue" when form is submitted.

Demo Recording

Screen.Recording.2024-12-17.at.7.32.38.PM.mov

rtBot

This comment was marked as resolved.

rtBot

This comment was marked as resolved.

rtBot
rtBot previously requested changes Dec 17, 2024
Copy link
Contributor

@rtBot rtBot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Previous scan continued.

$video_setup = wp_json_encode(
array(
'controls' => $controls,
'autoplay' => $autoplay,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Warning: Array double arrow not aligned correctly; expected 5 space(s) between "'autoplay'" and double arrow, but found 1 (WordPress.Arrays.MultipleStatementAlignment.DoubleArrowNotAligned).

array(
'controls' => $controls,
'autoplay' => $autoplay,
'loop' => $loop,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Warning: Array double arrow not aligned correctly; expected 9 space(s) between "'loop'" and double arrow, but found 5 (WordPress.Arrays.MultipleStatementAlignment.DoubleArrowNotAligned).

'controls' => $controls,
'autoplay' => $autoplay,
'loop' => $loop,
'muted' => $muted,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Warning: Array double arrow not aligned correctly; expected 8 space(s) between "'muted'" and double arrow, but found 4 (WordPress.Arrays.MultipleStatementAlignment.DoubleArrowNotAligned).

'autoplay' => $autoplay,
'loop' => $loop,
'muted' => $muted,
'preload' => $preload,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Warning: Array double arrow not aligned correctly; expected 6 space(s) between "'preload'" and double arrow, but found 2 (WordPress.Arrays.MultipleStatementAlignment.DoubleArrowNotAligned).

'loop' => $loop,
'muted' => $muted,
'preload' => $preload,
'poster' => $poster,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Warning: Array double arrow not aligned correctly; expected 7 space(s) between "'poster'" and double arrow, but found 3 (WordPress.Arrays.MultipleStatementAlignment.DoubleArrowNotAligned).

'muted' => $muted,
'preload' => $preload,
'poster' => $poster,
'fluid' => true,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Warning: Array double arrow not aligned correctly; expected 8 space(s) between "'fluid'" and double arrow, but found 4 (WordPress.Arrays.MultipleStatementAlignment.DoubleArrowNotAligned).

'preload' => $preload,
'poster' => $poster,
'fluid' => true,
'sources' => $sources,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Warning: Array double arrow not aligned correctly; expected 6 space(s) between "'sources'" and double arrow, but found 2 (WordPress.Arrays.MultipleStatementAlignment.DoubleArrowNotAligned).

'poster' => $poster,
'fluid' => true,
'sources' => $sources,
'id' => $id,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Warning: Array double arrow not aligned correctly; expected 11 space(s) between "'id'" and double arrow, but found 7 (WordPress.Arrays.MultipleStatementAlignment.DoubleArrowNotAligned).

'fluid' => true,
'sources' => $sources,
'id' => $id,
'easydam_meta' => $easydam_meta_data,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Warning: Array double arrow not aligned correctly; expected 1 space(s) between "'easydam_meta'" and double arrow, but found 5 (WordPress.Arrays.MultipleStatementAlignment.DoubleArrowNotAligned).

<?php endif; ?>

<!-- Dynamically render shortcodes for form layers -->
<?php if ( ! empty( $easydam_meta_data['layers'] ) ) :
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 Error: Opening PHP tag must be on a line by itself (Squiz.PHP.EmbeddedPhp.ContentAfterOpen).

rtBot
rtBot previously requested changes Dec 17, 2024
Copy link
Contributor

@rtBot rtBot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Previous scan continued.

<!-- Dynamically render shortcodes for form layers -->
<?php if ( ! empty( $easydam_meta_data['layers'] ) ) :
foreach ( $easydam_meta_data['layers'] as $layer ) :
if ( isset( $layer['type'] ) && $layer['type'] === 'form' && ! empty( $layer['gf_id'] ) ) : ?>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 Error: Use Yoda Condition checks, you must (WordPress.PHP.YodaConditions.NotYoda).

<!-- Dynamically render shortcodes for form layers -->
<?php if ( ! empty( $easydam_meta_data['layers'] ) ) :
foreach ( $easydam_meta_data['layers'] as $layer ) :
if ( isset( $layer['type'] ) && $layer['type'] === 'form' && ! empty( $layer['gf_id'] ) ) : ?>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 Error: Closing PHP tag must be on a line by itself (Squiz.PHP.EmbeddedPhp.ContentBeforeEnd).

if ( isset( $layer['type'] ) && $layer['type'] === 'form' && ! empty( $layer['gf_id'] ) ) : ?>
<div id="layer-<?php echo esc_attr( $layer['id'] ); ?>" class="easydam-layer hidden">
<?php
echo do_shortcode( sprintf(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 Error: Opening parenthesis of a multi-line function call must be the last content on the line (PEAR.Functions.FunctionCallSignature.ContentAfterOpenBracket).

echo do_shortcode( sprintf(
"[gravityform id='%d' title='false' description='false' ajax='true']",
intval( $layer['gf_id'] )
) );
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 Error: Closing parenthesis of a multi-line function call must be on a line by itself (PEAR.Functions.FunctionCallSignature.CloseBracketLine).

) );
?>
</div>
<?php elseif ( isset( $layer['type'] ) && $layer['type'] === 'cta' ) : ?>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 Error: Use Yoda Condition checks, you must (WordPress.PHP.YodaConditions.NotYoda).

<!-- Add sample button for now -->
<button class="cta-button">Call To Action</button>
</div>
<?php endif;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 Error: Opening PHP tag must be on a line by itself (Squiz.PHP.EmbeddedPhp.ContentAfterOpen).

</div>
<?php endif;
endforeach;
endif; ?>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 Error: Closing PHP tag must be on a line by itself (Squiz.PHP.EmbeddedPhp.ContentBeforeEnd).

endif; ?>
</div>
</figure>
<?php endif;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 Error: Opening PHP tag must be on a line by itself (Squiz.PHP.EmbeddedPhp.ContentAfterOpen).

rtBot

This comment was marked as resolved.

@rtBot
Copy link
Contributor

rtBot commented Dec 17, 2024

GitHub API communication error. Please contact a human. (commit-ID: bac1a68).

@rtBot rtBot dismissed stale reviews from themself December 17, 2024 14:13

Dismissing review as all inline comments are obsolete by now

@subodhr258 subodhr258 marked this pull request as ready for review December 17, 2024 14:37
@@ -37,9 +37,9 @@
The minimum version set here should be in line with the minimum WP version
as set in the "Requires at least" tag in the readme.txt file. -->
<rule ref="WordPress.WP.DeprecatedFunctions">
<properties>
<!-- <properties>
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Uncommented the phpcs rule.

@KMchaudhary KMchaudhary merged commit cf8732a into master Dec 18, 2024
1 of 3 checks passed
@subodhr258 subodhr258 deleted the feat/player-frontend branch February 26, 2025 14:33
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.

3 participants