You need to use the player's API because you cannot enter code inside an iframe in a third-party domain.
According to the docs provided for the playerโs API, t should look something like this.
Working example
<html> <head> <script type="text/javascript"> var _gaq = _gaq || []; _gaq.push(['_setAccount', 'UA-XXXXXX-1']); _gaq.push(['_trackPageview']); (function() { var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true; ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js'; var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s); })(); </script> <script> var f = document.getElementsByTagName('iframe')[0], url = f.src.split('?')[0]; </script> </head> <body> <iframe src="http://player.vimeo.com/video/27855315?api=1" width="400" height="225" frameborder="0" webkitAllowFullScreen mozallowfullscreen allowFullScreen></iframe> </body> </html>
The above code can be simplified a using the Vimeo Mogaloop api, which abstracts the message passing API for you by loading Javascript into the library.
Plugins Ready to Use
Please note that the code above will only work as an example, and if you have several videos on a page, it can be more difficult to do it right. Alternatively, you can also use GAS (Iโm the main developer there), which has a plug-in for tracking Vimeo Video .
Compatibility warning
Pay attention to the compatibility warning, I think if you insert the player using the flash method, you can get a wider range of supported browsers, but completely destroy the player for iOS devices:
When using the Universal Embed Code, the only way to interact with the player is using window.postMessage. postMessage is relatively new so it is only available in Internet Explorer 8+, Firefox 3+, Safari 4+, Chrome, and Opera 9+.
source share