0

I want to click the video on this page http://37.128.191.200/?640 using JavaScript but can't figure out how

document.getElementById('container').click()

does not work

1
  • If your intent is to make that video play programmatically, please say so Commented Jun 26, 2012 at 17:51

3 Answers 3

2

Since manually clicking that video will make it play the video, I am guessing you want to do that.

You can run this on the page to do that:

jwplayer().play()
Sign up to request clarification or add additional context in comments.

Comments

2

You can use your JwPlayer object.

jwplayer('container').play()

Comments

1

use element.dispatchEvent instead. So your code could be:

var evt = document.createEvent("MouseEvents");
evt.initMouseEvent("click", true, true, window, 0, 0, 0, 0, 0, false, false, false, false, 0, null);

document.getElementById('container').dispatchEvent(evt)

See more details in https://developer.mozilla.org/en/DOM/element.dispatchEvent

1 Comment

Will that work with flash? Looks like it just triggers javascript events.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.