• Is there any way to include playlist code in PHP API – that would be super useful.

    Great plugin, very nice! Also that metablock plugin is killer.

Viewing 1 replies (of 1 total)
  • Plugin Author Phi Phan

    (@mr2p)

    Hi @efrap,

    Thank you for kind words. Here is the snippet code to display a playlist with the PHP API:

    better_youtube_embed_block_render_block(
    [
    'url' => 'https://youtu.be/paSXmpHU9K4',
    'aspectRatio' => '16/9',
    'isMaxResThumbnail' => false,
    'caption' => 'My awesome video',
    'customThumbnail' => 'https://example.com/bg.jpg',
    'settings' => [
    'multipleMode' => 'playlist',
    'playlistId' => 'play_list_id_here'
    'loop' => 1,
    ],
    'echo' => false,
    ]
    );

    Here is the snippet code to display multiple videos with the PHP API:

    better_youtube_embed_block_render_block(
    [
    'url' => 'https://youtu.be/paSXmpHU9K4',
    'aspectRatio' => '16/9',
    'isMaxResThumbnail' => false,
    'caption' => 'My awesome video',
    'customThumbnail' => 'https://example.com/bg.jpg',
    'settings' => [
    'multipleMode' => 'multiple',
    'videoIds' => 'video_id_1,video_id_2'
    'loop' => 1,
    ],
    'echo' => false,
    ]
    );

    Please customize the parameters to fit your requirments.

    Best, Phi.

Viewing 1 replies (of 1 total)
  • You must be logged in to reply to this topic.