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

  • SEARCH
  • Home
  • 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 9215403
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T02:11:50+00:00 2026-06-18T02:11:50+00:00

I have a plugin for html5 videos that I’m currently working on and want

  • 0

I have a plugin for html5 videos that I’m currently working on and want to select specifically each video separately on a web page. It starts as you would usually start:

(function($) {

$.fn.videoPlayer = function(options) {


    var settings = {  
        playerWidth : '0.95', // Default is 95%
        videoClass : 'video'  // Video Class
    }

    // Extend the options so they work with the plugin
    if(options) {
        $.extend(settings, options);
    }



    // For each so that we keep chainability.
    return this.each(function() {       


        // Basic Variables 
        $this = $(this);
        $settings = settings;

So since I’m doing for each in the plugin I expected that each video would be selected separately and specifically but this is not the case. So if I want to do something like this:

$this.play();

It does not work. Instead, I have to do this or I get an error about that element not having that method:

$this[0].play();

This won’t work for a plugin since I need to apply this to all videos and this will only select the first video on the page. So how do I go about fixing this? I’m also having some trouble with waiting for loadedmetadata which seems to mess up all the videos on the page in some way (I assume because I have to wait or because of a related error to what I’ve mentioned above?)

Any ideas?

  • 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-06-18T02:11:51+00:00Added an answer on June 18, 2026 at 2:11 am

    .play() is a native DOM method, so use this directly:

    this.play();
    

    Since you’re first wrapping this in jQuery – and only calling play on $this – you get an error, as jQuery does not have a play method.


    P.S. Using $this[0].play() would also work. It won’t select the first video, since it’s using the this value of the each callback, which only ever has one element in its collection…

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

Sidebar

Related Questions

I have been working on a jquery plugin that uses a HTML5 audio player
I have developed one API for HTML5 Video. The specialty of the plugin is
I want to display videos using Flash (for older, non-HTML5 video browsers). This is
I have some HTML that is being produced by a WordPress plugin that is
I have a plugin that is loaded by this application.. This plugin calls some
We have a plugin system on a WCF service that checks libraries placed in
im working with the jquery ui draggable plugin and i have an html 5
I have a custom plugin that was made for powerpoint and has a functionality
I have developed an app in phonegap (html5, JQuery, JS) and I want to
Hi i have created the following ckeditor plugin to insert a youtube video: (function()

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.