I’ve been fighting this for a while on a series of themes I make that provide a front end content creation interface not requiring a WP account. For the last two years I have said “trust me, URLs will embed”.
Those old tickets are dormant, but I just have found a solution here
https://wordpress.stackexchange.com/a/287623
For the template that renders the page you are using for your form, you need to add an enqueue statement.
This is some partial code on a site where auto embeds are not working on an editor added via wp_editor()
add_action('wp_enqueue_scripts', 'add_truwriter_scripts');
function add_truwriter_scripts() {
// set up main styles
$parent_style="radcliffe_style";
wp_enqueue_style( $parent_style, get_template_directory_uri() . '/style.css' );
wp_enqueue_style( 'child-style',
get_stylesheet_directory_uri() . '/style.css',
array( $parent_style ),
wp_get_theme()->get('Version')
);
if ( is_page('write') ) { // use on just our form page
// Get Embed functionality in rich text editor
// h/t https://wordpress.stackexchange.com/a/287623
wp_enqueue_script( 'mce-view' );
:
:
// unrelated code follows