on wordpress homepage, have embed vimeo video, when video ends, needs go portfolio page.
i found many examples of vimeo api , froogaloop, https://developer.vimeo.com/player/js-api, tried , no 1 worked. found wordpress jquery has bit different, used code should working in wordpress. use avada theme , have code box in page construction have entered code:
<script src="http://a.vimeocdn.com/js/froogaloop2.min.js"></script> <div class='fullscreen_block fw_background bg_video'> <iframe id="vimeovideo" style='left: 0% !important; top: 0% !important;' src="http://player.vimeo.com/video/158002922?autoplay=1&loop=0&api=1&showinfo=0&controls=0&color=ff4600&title=0&byline=0&portrait=0&player_id=vimeovideo'" width="100%" height="100%" frameborder="0" webkitallowfullscreen mozallowfullscreen allowfullscreen></iframe></div> <script> jquery(document).ready(function ($) { var iframe = $('#vimeovideo')[0], player = $f(iframe); player.addevent('ready', function() { player.addevent('finish', onfinish); }); function onfinish(id) { window.location.href = 'http://xxxhereismywebsitexxx.com/portfolio/'; } }); </script>
the video plays fine, , @ end nothing. why redirect not working? if inspect, console shows me error:
froogaloop2.min.js:1 uncaught typeerror: cannot read property 'ready' of undefined
i looked , there modified version of frogaloop not gives error. tried 1 too, no success.
can me further? there no more information on net.
there other websites have working wp, tried copy js code same.