Custom Fields
Support Meta Box Group How to the video field for group type?

  • Creator
  • #8793
    Resolved alisha

    How are you doing?Hope doing well.Now let you know my problem.
    Simply, I cannot display video field using group type.
    I am using following code to create meta box:
    I am using following codes to show the video but no result:
    It shows following error:
    Warning: Illegal string offset 'src' in C:\wamp\www\wordpress\wp-content\themes\skeleton\framework\about-us\facility.php on line 41
    please help me.

Viewing 3 replies - 1 through 3 (of 3 total)
  • Author
  • #8805
    Anh Tran


    Thanks. I'm good 🙂

    Regarding the video field, when getting from the group, it's just the IDs of the uploaded videos. To output the videos, you can do like this:

    foreach ( $facilities_videos as $facilities_video ) {
        $facilities_video = RWMB_Video_Field::file_info( $facilities_video );
        <video src="<?php echo $facilities_video['src']; ?>">
    <?php } ?>


    I want to output a video player with playlist but how to do that using Meta Box Builder and MB Views, in detail the video custom field within a group field?

    What are the steps or what is the twig code to achieve that? Can you please give a complete example. Thank you!

    Anh Tran

    Hi Daniel,

    Currently, MB Views allows you to display videos one by one, e.g. not in a playlist. To do that, please select the video field from the inserter panel.

    To display all videos in a playlist, please use this Twig snippet below:

    {% set videos = mb.rwmb_meta( 'video_field_id', '', post.ID ) %}
    {% set video_ids = mb.implode( ',', mb.wp_list_pluck( videos, 'ID' ) ) %}
    {{ mb.wp_playlist_shortcode( {ids: video_ids, type: 'video'} ) }}
Viewing 3 replies - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.