Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 9 of 9
  1. #1
    New to the CF scene
    Join Date
    Feb 2015
    Posts
    6
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Actions on Vimeo play/pause

    Hi,
    I was wondering if there was any action I could use that recognises when a video has started playing and simply fades out some images and then when pause is pressed they fade back in. I would be using a Vimeo video embedded if that helps.

    Many thanks

  • #2
    Senior Coder Dormilich's Avatar
    Join Date
    Jan 2010
    Location
    Behind the Wall
    Posts
    4,027
    Thanks
    14
    Thanked 420 Times in 416 Posts
    if vimeo uses the <video> tag, you can use the appropriate event for that.
    The computer is always right. The computer is always right. The computer is always right. Take it from someone who has programmed for over ten years: not once has the computational mechanism of the machine malfunctioned.
    André Behrens, NY Times Software Developer

  • #3
    Senior Coder xelawho's Avatar
    Join Date
    Nov 2010
    Posts
    3,121
    Thanks
    56
    Thanked 579 Times in 575 Posts
    Plenty of example code here: https://developer.vimeo.com/player/js-api

  • #4
    New to the CF scene
    Join Date
    Feb 2015
    Posts
    6
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Thank you for the replies.

    I'm quite new to javascript and finding the vimeo API examples a little hard to adapt to what I want to achieve. Could someone provide me with the basic script so when play is clicked on a vimeo player an event is triggered? Then I can see if it will work on the normal 'plus' account or i'll need to buy the 'pro' for full control.

  • #5
    New to the CF scene
    Join Date
    Feb 2015
    Posts
    6
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Thought i'd post what I have so far. It's cobbled together from everywhere so excuse how bad it is!
    I can get the image "circle" to fade out but I want that to happen onPlay not pause. It doesn't seem to work onPlay:

    $(function() {
    var iframe = $('#player1')[0];
    var player = $f(iframe);
    var status = $('.status');

    player.addEvent('ready', function() {

    player.addEvent('pause', onPause);
    player.addEvent('finish', onFinish);
    player.addEvent('play', onPlay);
    });


    function onPause(id) {
    $("#circle").fadeOut("slow");
    }

    function onPlay(id) {
    $("#circle").fadeOut("slow");
    }
    });

  • #6
    New to the CF scene
    Join Date
    Feb 2015
    Posts
    6
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Any ideas?

  • #7
    Senior Coder xelawho's Avatar
    Join Date
    Nov 2010
    Posts
    3,121
    Thanks
    56
    Thanked 579 Times in 575 Posts
    If it works on play it should work on pause although this:
    var player = $f(iframe);
    looks a little strange.

    Do you have a link to a live page?

  • #8
    New to the CF scene
    Join Date
    Feb 2015
    Posts
    6
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Here's it on jsfiddle:
    https://jsfiddle.net/gqdhdoq2/2/

  • #9
    New to the CF scene
    Join Date
    Feb 2015
    Posts
    6
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Did anyone manage to have a look at the link?


  •  

    Tags for this Thread

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •