bp_media_activity_embed_gif_content( $activity_id )

Return activity gif embed HTML

Description

Parameters

$activity_id

(Required)

Return

(false|string|void)

Source

File: bp-media/bp-media-filters.php

1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
function bp_media_activity_embed_gif_content( $activity_id ) {
 
    $gif_data = bp_activity_get_meta( $activity_id, '_gif_data', true );
 
    if ( empty( $gif_data ) ) {
        return;
    }
 
    $preview_url = wp_get_attachment_url( $gif_data['still'] );
    $video_url = wp_get_attachment_url( $gif_data['mp4'] );
 
    ob_start();
    ?>
    <div class="activity-attached-gif-container">
        <div class="gif-image-container">
            <div class="gif-player">
                <video preload="auto" playsinline poster="<?php echo $preview_url ?>" loop muted playsinline>
                    <source src="<?php echo $video_url ?>" type="video/mp4">
                </video>
                <a href="#" class="gif-play-button">
                    <span class="dashicons dashicons-video-alt3"></span>
                </a>
                <span class="gif-icon"></span>
            </div>
        </div>
    </div>
    <?php
    $content = ob_get_clean();
 
    return $content;
}

Changelog

Changelog
Version Description
BuddyBoss 1.0.0 Introduced.

Questions?

We're always happy to help with code or other questions you might have! Search our developer docs, contact support, or connect with our sales team.