0

I am watching football videos and collecting data, I have set up a webpage that plays the video in the middle of the screen while I click scroll buttons of different aspect of the game, at the end I submit the data into a database. At the moment I am just pasting the URL into the code and refreshing the page.

I want an easy way to paste an embed URL into a text box in the same webpage and the video will load in the iframe automatically (without the need to click a submit button, something like onpaste function, if it exists), I assume some javascript may need to be used.

I don't want to go away from the page (even for a few seconds - the task is tedious enough), I have a list of games I want to watch and with URLs ready to be pasted.

Is there a way to do this?

Edits 1. This is a typical URL with the iframe info

<iframe width="950" height="534" src="https://www.youtube.com/embed/xouOxFziuIk" frameborder="0" allowfullscreen></iframe>
  1. also I am not experienced with Javascript so I have not tried anything.

  2. The iframe (because of the way the page is set up) is inside a form tag

Aasim Azam
  • 498
  • 2
  • 6
  • 23
  • Yes, [there is a paste event](http://stackoverflow.com/questions/6035071/intercept-paste-event-in-javascript). What code have you tried and what URLs are you processing... YouTube or something custom? – Mottie May 14 '16 at 20:42
  • You could extract the URL when it is pasted into the document. https://www.w3.org/TR/clipboard-apis/#the-paste-action – Jon Koops May 14 '16 at 20:42
  • http://codepen.io/acousticsman/pen/aNxjwK - the code – Aasim Azam May 14 '16 at 20:58

0 Answers0