Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 5959135
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T18:38:34+00:00 2026-05-22T18:38:34+00:00

I’m building a plugin to WordPress and so far so good with the PHP

  • 0

I’m building a plugin to WordPress and so far so good with the PHP library. But I am having some issues with the JavaScript API.

I’m trying to use it with jQuery, and I think the WordPress version of jQuery is messing with the $f shortcut. Why wouldn’t this work?

var vimeoPlayer = {

    init: function() {
        var vimeoPlayers = document.querySelectorAll('iframe'),
        player;

        jQuery('iframe.vimeo-player').each(function(index, iframe){
            player = vimeoPlayers[index];
            $f(player).vimeoPlayer.addEvent('ready', vimeoPlayer.ready);
        });
    },

    addEvent: function(element, eventName, callback) {
        if (element.addEventListener) {
            element.addEventListener(eventName, callback, false);
        }
        else {
            element.attachEvent(eventName, callback, false);
        }
    },

    ready: function(player_id) {
        alert(player_id);
    }
}

jQuery(document).ready(function($){
    vimeoPlayer.init.call();
});

You can see it in action at temp.woodshop.tv/?work/?dickies-campaign/?.

I get this error:

TypeError: Result of expression ‘$f(player).vimeoPlayer’ [undefined] is not an object.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-22T18:38:35+00:00Added an answer on May 22, 2026 at 6:38 pm

    One issue is that addEvent is both a function that you’ve defined and also a method of the $f(player) object. It appears that you’re confusing the two. The addEvent method of the $f(player) object only takes two arguments, the name of the player event and the function to be called. It should be used as $f(your-iframe).addEvent(‘vimeo event’, your_function);

    Your addEvent function will unify events between IE and W3C methods. It’s not needed because you’re using jQuery. jQuery(whatever).click() does the same thing. I don’t see any part of your snippet where you need it but if you do, I’d just use the jQuery method.

    Also, the video player object should be $f(player) instead of $f(player).vimeoPlayer

    Try this

    jQuery('iframe.vimeo-player').each(function(){
        $f(this).addEvent('ready', ready);
    });
    

    Another thing to note is that any additional player events need to be added from your ready callback function. For example:

    function ready(player_id){
        $f(player_id).addEvent('play', play);
        $f(player_id).api('play');
        alert("Ready!!!");
    }
    function play(){
        alert("Playing!!!");
    }
    

    I’ve had a hard time finding the info I want on Vimeo’s Froogaloop api but after scouring Vimeo Froogaloop API Playground about a dozen times I’m starting to get the idea of how it works.

    Good luck!

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I need to clean up various Word 'smart' characters in user input, including but
We are using XSLT to translate a RIXML file to XML. Our RIXML contains
i want to parse a xhtml file and display in UITableView. what is the
public static bool CheckLogin(string Username, string Password, bool AutoLogin) { bool LoginSuccessful; // Trim

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.