• I have a video embedded in a page using the built in WordPress shortcode.
    I want to trigger the video to play if a cookie is not present. I have the code in place for the cookie detection, but I can’t figure out a command to make the video play.

    Among many other things I’ve tried this: jQuery(“.mejs-video”).play();
    but js tells me ‘jQuery(“…”).play is not a function’

    Can anyone help?

Viewing 1 replies (of 1 total)
  • You can do it this way:
    $( 'video' )[0].player.play();

    This targets your first video. If you have multiple videos you can use a unique selector like ID.

Viewing 1 replies (of 1 total)

The topic ‘wp-video-shortcode – play via js’ is closed to new replies.