When using Vimeo's JS API, the player.loadVideo() method will revert the player's settings back to their default options

Using Vimeo's player.js API, I'm setting options on the player to disable the title upon initialization:

var options = {
    id: 59777392,
    title: false
};
var vimPlayer = new Vimeo.Player('myDiv', options);

The video player correctly displays without a title as expected.

However, when loading a different video using the loadVideo() method, the 'title: false' option seems to be overridden:

player.loadVideo(76979871);

Subsequent loads display the title, despite the initial setting.

Is there a way to maintain the 'title: false' option throughout all video loads? I've tried setting the attribute 'data-vimeo-title="false"' on the div itself and passing options in the loadVideo() function, but with no success.

Answer №1

Consider implementing a function to handle this task.

let youtubePlayer;

function playVideo(videoId) {

    let settings = {
        id: videoId,
        title: true
    };

    youtubePlayer = new YouTube.Player('videoBox', settings);
}

playVideo(12345678);

Furthermore, based on user input:

playVideo(87654321);

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

Encountering a problem with the getJSON() function within the app.js file connected to a solidity

Currently, I am working on developing a simple dapp in Truffle. However, I encountered an error when using $.getJSON() function in my app.js file. Below is a snippet of my app.js: App ={ web3Provider: null, contracts: {}, init: function (){ return A ...

Generate a novel item by organizing the key of an array of objects

I have an array of objects containing various items: [ { CATEGORY:"Fruits" ITEM_AVAIL:true ITEM_NAME:"Apple" ITEM_PRICE:100 ITEM_UNIT:"per_kg" ITEM_UPDATED:Object ORDER_COUNT:0 }, { CATEG ...

Is there a way to verify within the "if" statement without repeating the code?

Is there a way in javascript (or typescript) to prevent redundant object rewriting within an if statement condition? For example: if (A != null || A != B) { // do something here } // can it be done like this: if (A != null || != B) { // avoid repeating ...

Transferring a variable between a JavaScript function and a Java class

Currently, I am working with STS and building an application that includes HTML files and JavaScript. Within this file, there is a function that configures variables. <!DOCTYPE html> <html xmlns="http://www.w3.org/1999/xhtml" xmlns:th="http://www ...

What is the best way to access props from a different file in a React application?

I am facing a challenge with my two files: EnhancedTableHead and OrderDialog. I need to access the props data from EnhancedTabledHead in my OrderDialog file. Is there a way to achieve this? Here is how my files are structured: //OrderDialog.jsx import ...

The output from the lodash sortBy function is not aligning with the anticipated result

Sorting this array based on the attributes age and user has become my current challenge. The priority is to first sort by age, followed by sorting by user. In cases where the ages are the same, the sorting should be done based on the user attribute. var us ...

Incorporate a 1-second delay for each value in the stream using Bacon.js

Here is my code snippet: var bulk = array[1,2,3,4] var finalResult = Bacon .fromArray(bulk) .flatMap(isValInCouchDb) .filter(onesThatExist) .flatMap(putValInCouchDb) I want to introduce a 1-second delay after the filter operation before e ...

Using & in text leads to segmentation upon transmission to the server

When utilizing ng-resource to send a string to the server, I encountered an issue. If I include &amp; in the string, anything following it is not transmitted to the server. For instance, sending this string: "This section of the string is visible &am ...

What is the most effective way to eliminate error messages from the email format checker code?

Recently, I've been working on a code to validate forms using javascript/jquery. One particular issue I encountered was related to checking email format. The problem arose when entering an invalid email - the error message would display correctly. How ...

Exploring Linked Data in JSON API Response with Rails API, Active Model Serializer, and Vue.js Single Page Application

I am working with data structured in a tree/hierarchical model for climbing areas, where they are connected through parent and child relationships. By utilizing the JSON API adapter along with my Active Model Serializer, class AreaSerializer < ActiveM ...

What could be causing the 304 error when using $http.get?

I'm a newcomer to angular and facing an issue with a service that was functioning perfectly, but suddenly stopped. The service I am referring to has the following method. this.retrieveForms = function() { return $http.fetch("/forms"). then(fu ...

I am interested in creating a class that will produce functions as its instances

Looking to create a TypeScript class with instances that act as functions? More specifically, each function in the class should return an HTMLelement. Here's an example of what I'm aiming for: function generateDiv() { const div = document.crea ...

Begin by opening a single div for each instance

I want a functionality where opening one div closes all the others. I've searched around for solutions and only found jQuery options, not pure JavaScript ones. Here is my code: function openDescription(description_id) { var x = document.getEle ...

An issue has arisen while trying to run NPM start on ReactJS

Having trouble starting npm (ReactJS) Whenever I try to run the terminal command npm start An error message is displayed: ERROR in multi (webpack)-dev-server/client?http://localhost:8080 webpack/hot/dev-server /index.js Module not found: Error: Can& ...

Tips for utilizing the AngularJS filter to group by two columns in Angular

In my array of objects, each item has three properties: 1. name 2. team 3. age http://jsfiddle.net/HpTDj/46/ I have successfully grouped the items by team, but I am unsure how to group them by both team and age in my current code. I want to display the ...

Using Node and Express to handle form submissions, we can create a POST request that sends data to the server

Despite my ongoing learning journey, I am feeling a bit frustrated as I struggle to find a solution for this particular issue using ES6 Javascript. Currently, I have a straightforward todo-list web-app where everything is managed and displayed through the ...

Deleting an element from a JavaScript array

I have a collection of javascript functions that manage intervals by setting and clearing them. The intervals are stored in an array called intervals[]. config: { settings: { timezone: 'Australia/Perth,', base_url: location.p ...

Unpredictable preset inline styles for HTML input elements

While developing a full-stack MERN application, I encountered an unusual issue when inspecting my React UI in Chrome DevTools. If any of these dependencies are playing a role, below are the ones installed that might be contributing to this problem: Tail ...

Modifying array elements in JavaScript without explicit instructions

I am relatively new to Javascript and seem to be encountering a rather puzzling issue that I'm unable to resolve. Currently, I have two classes: Country and PPM_Data. The Country class contains parameters such as name, area, ppm, etc., along with a f ...

Discovering the quantity of identical elements within a JavaScript array

Looking for some assistance in solving a JavaScript problem as I am relatively new to the language: I have an array and I need help in determining the count of identical values. Below is my array: var arr = ["red", "blue", "green", "red", "red", "gray"] ...