WP Discourse - Template Customization

works beautifully!!! Thank you!!!

but there are 2 embeds intead of one.

output is below. anything wrong with the code you suggested to me?

<small>Originally published at http://staging.a1.sg/beautiful/</small><br><br><iframe src="https://www.youtube.com/embed/alJEZwwtQ3U" width="560" height="315" frameborder="0" allowfullscreen="allowfullscreen"></iframe><br><p><iframe src="https://www.youtube.com/embed/alJEZwwtQ3U" width="560" height="315" frameborder="0" allowfullscreen="allowfullscreen"></iframe></p>

add_filter( 'discourse_publish_format_html', 'my_namespace_publish_format', 10, 2 );
function my_namespace_publish_format( $input, $post_id ) {
	$post_content = apply_filters( 'the_content', get_post( $post_id )->post_content );
	$videos = get_media_embedded_in_content( $post_content );
	$video_string = '';
	foreach( $videos as $video ) {
	    $video_string .= $video . '<br>';
    }
    ob_start();

    echo '<small>Originally published at {blogurl}</small><br><br>';
    echo $video_string;
    echo '{excerpt}';
    $output = ob_get_clean();

    return $output;