Stop all vimeo videos

to confirm:
you download the zip
open the hypefile
press preview in say chrome
press play button on the video
press number one to switch the scene
and then the video does not stop?

can you have a look in the browserconsole to see if the listener logged paused or if any erro is listed?

I had a javascript guy troubleshoot as I needed to get on top of it.
Its working so Ill document it next week as soon as Ive got over this immediate problem of my courses not working

This is what Im using and it works
I used Jonathans script (above)
I embed the Vimeo like this
iframe src="https://player.vimeo.com/video/123456789?api=1" width="990" height="460"></iframe

and put this in the html head
script src="https://s3-us-west-2.amazonaws.com/s.cdpn.io/3/froogaloop.js"></script

(don't forget the open and close< and > which I can't seem to put here

but please take in consideration that the froogaloop-library is depreciated since some years now and functionality may break anytime. some info and links: 'froogaloop' tag wiki - Stack Overflow , https://github.com/vimeo/player.js/blob/master/docs/migrate-from-froogaloop.md

Thanks Hans
So what is the best solution?

i would not like to rely on software that is depreciated for about 4 or five years. vimeo itsself does not promote froogallop in anyway. the links above explain the new libraries API... but i'm no expert regarding the vimeostuff ...

Can anyone post a best practice sample on how to pause a vimeo stream?

I just got this from Vimeo today...
the Froogaloop library for the Vimeo Player has been deprecated and is no longer being supported. We recommend developers switch to the new Player.JS library instead. More information about the library can be found here:

https://player.vimeo.com/api/demo

var player = new Vimeo.Player(iframe);

this is a line initializing your player with the vimeo-iFrame as argument

player.pause()

will pause the player

the steps to migrate are well discribed ... try give it a go :slight_smile:

I tried :frowning:

I've attached a basic example. The ways it is constructed are:

  1. This player API script has been imported in the Head HTML
  2. Rectangle elements are made and vimeo's iframe code is placed inside of there
  3. There's a button that runs a function which looks at all iframes on the page, finds which ones are vimeo videos (by seeing if the src references vimeo), and then uses the API for each to call pause.

VimeoPause.hype.zip (17.5 KB)

It seems vimeo by default only lets one video play at a time, so I couldn't really test pausing all, but this does seem to pause the playing video.

1 Like

Thanks Jonathan
this has been a source of stress for me as all 100+ videos of mine stopped working as they should.