This works for me on both YouTube and Vimeo. I just simply reload the src attribute, so keep in mind that the video will revert to the beginning.
var $theSource = $theArticleDiv.find('.views-field-field-video-1 iframe').attr('src'); $theArticleDiv.find('.views-field-field-video-1 iframe').attr('src', $theSource);
$ theArticleDiv is my current video container, since I have several videos on the page and they are displayed through the Drupal view at runtime, I donβt know what their identifiers will be. So I connected the muy click event with the currently visible element, found its parent and decided that $ theArticleDiv.
('. views-field-field-video-1 iframe') finds the current video clip for me - in particular the one that is visible right now. This iframe has an src attribute. I just pick it up and reset back to what it already was, and automatically the video stops and goes back to the beginning. If my users want to pause and resume, they can do it without closing the video, of course, but frankly, if they close the video, I feel that they can live with the fact that it is reset to the beginning.
NTN
Sam Moore Dec 18 '12 at 7:17 2012-12-18 19:17
source share