I tried adding the following code to the functions.php file to change the output of an embedded Youtube video but nothing changes. I tried this with a plain WordPress install and changing to the Twenty Twenty theme and it worked with that theme but not GeneratePress.
add_filter( 'embed_oembed_html', 'append_oembed_html', 99, 4 );
function append_oembed_html( $cache, $url, $attr, $post_id ) {
if ( false !== strpos( $url, "://youtube.com") || false !== strpos( $url, "://youtu.be" ) ) {
$cache = $cache . '<br>video link: '. $url .'';
}
return $cache;
}