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

Update BunnyNet.php #2

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion includes/Integration/BunnyNet.php
Original file line number Diff line number Diff line change
Expand Up @@ -186,11 +186,13 @@ public static function is_bunnynet_video_source() {
* @return string video content
*/
private static function get_embed_video( $bunny_video_id ):string {
// Ensure the URL uses the embed format
$embed_url = str_replace('https://iframe.mediadelivery.net/play', 'https://iframe.mediadelivery.net/embed', $bunny_video_id);
ob_start();
?>
<div class="tutor-video-player">
<div style="position: relative; padding-top: 56.25%;">
<iframe src="<?php echo esc_attr( $bunny_video_id ); ?>" loading="lazy" style="border: none; position: absolute; top: 0; height: 100%; width: 100%;" allow="accelerometer; gyroscope; autoplay; encrypted-media; picture-in-picture;" allowfullscreen="true"></iframe>
<iframe src="<?php echo esc_attr( $embed_url ); ?>" loading="lazy" style="border: none; position: absolute; top: 0; height: 100%; width: 100%;" allow="accelerometer; gyroscope; autoplay; encrypted-media; picture-in-picture;" allowfullscreen="true"></iframe>
</div>
</div>
<?php
Expand Down