Cortado Ogg-player in MediaElement.js - on the verge of full functionality

After modifying the MEjs demo player, I successfully enabled OGG playback in IE/Safari browsers by incorporating the Cortado Java applet.

Although I got play/pause functionality working, applet.currentTime and applet.duration proved to be effective alternatives despite getPlayPosition() not providing the expected result as per the documentation.

My attempt to link these functionalities with the current position indicators on the mejs player encountered a stumbling block. The setCurrentTime method triggered a

DOM Exception: InVALID_STATE_ERR (11)
in IE, leading to similar errors in Safari. It appears that the targeted object is no longer accessible?

The provided code allows for playing and pausing, displaying seconds/total time in the console (F12 tools need to be enabled in IE). Is there a recommended approach to integrate this with the play bar?

<!DOCTYPE html>
<html>
...
... <!-- Code continues here -->
...
</html>

This implementation utilizes MeJS 2.10.3 version.

Answer №1

[UPDATE]
Upon reviewing the code for MediaElement.js, it appears that mejs.players is actually an object instead of an array. To access the first player, you should look into mejs.players['mep_0'] rather than mejs.players[0], as it would result in undefined.


It seems likely that jQuery could be encountering difficulties creating an interactive <applet> element. In my experience, jQuery (which heavily relies on document.createDocumentFragment) sometimes struggles to attach or trigger events on dynamically created or cloned DOM nodes, particularly in IE. This issue might be causing the DOM error you're facing, possibly due to the failure to initialize your <applet> object.

To potentially resolve this issue, I recommend using the native methods document.createElement and document.appendChild instead of jQuery.append.

if (jQuery(this.$node).find('applet').length==0) {
    var createElem = function(name, attributes) {
        var el = document.createElement(name);
        attributes = attributes || {};
        for (var a in attributes) {
            el.setAttribute(a, attributes[a]);
        }
        return el;
    };
    var applet = createElem('applet',{
        code:'com.fluendo.player.Cortado.class',
        codebase: 'http://theora.org/',
        archive: 'cortado.jar',
        width: 100,
        height: 100
    });
    applet.appendChild(createElem('param', {name:'url', value:d.src}));
    applet.appendChild(createElem('param', {name:'seekable', value: 'true'}));
    applet.appendChild(createElem('param', {name:'autoPlay', value: 'false'}));
    this.$node.get(0).appendChild(applet);
}

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

Correct the spacing around periods, even within separate div elements

I am facing a challenge with a large json file resembling a decision tree, where each node contains a sentence. There are multiple buttons on the page, and each click on a button retrieves a node from the json to populate the HTML. The json structure: { ...

The drop-down menu fails to appear when I move my cursor over it

#menu { overflow: hidden; background: #202020; } #menu ul { margin: 0px 0px 0px 0px; padding: 0px 0px; list-style: none; line-height: normal; text-align: center; } #menu li { display: inline-block; } #menu a { display: block; position: relative; padding ...

Efficiently verifying elements within an array

I have a roster of students categorized based on their activity status - some are active, while others are inactive. var allActive = [{id: 1, active: true}, {id: 2, active: true}, , {id: 3, active: true}]; var someNot = [{id: 4, active: true}, {id: 5, act ...

Trouble with VueJS: @change event not triggered when <input> value changes

In my VueJS project, I am working with two separate components: One is a modal and the other is a form. Within the modal component, the user inputs a PIN which is then confirmed. This value is then set to an input tag in the form component to save it. T ...

Ajaxload script for mouseover events

I am working on implementing a mouseover event for images displayed on a webpage to show a brief summary of the image in a container called "contentarea". As a newbie in coding, I apologize for any shortcomings. Below is the code I've created, but I&a ...

Present the selected values in the correct manner

My app uses a select tag to add values in a table. This select allows me to choose one value and add it to the table. Here is some of the code for the select input: const searchPlayer = selectedItems => { selectedItems = selectedItems.map(name =& ...

Using D3.JS, you can determine the minimum and maximum values within an array of arrays, a feature that is not

My data is structured as an array of arrays, with each inner array containing objects like this: series = [ [ { "x":2013-01-01, "y":100 }, { "x":2013-01-02, "y":300 } ...], [ { "x":2013-01-01, "y":1000 }, { "x":2013-01-02, "y":300 } ...],... ...

Exploring the Power of Arrays, For-Loops, and Functions in JavaScript

Currently, I have a functional code implementation, but I'm struggling with creating a proper loop. I'm seeking a solution to develop a function that changes the URL source of #mainImage to the one in the imgUrl array when hovering over an #id i ...

Simultaneous appearance of multiple jQuery dialogs

As I work on creating a team page, each team member has their own div that contains a photo and employee information. My goal is to have a dialog box pop up when the photo is clicked, using the $this context to retrieve the employee data from the same div. ...

Using Vue to pass an array of rules to a child component

Currently, I am passing a set of props called "propSet" to a child component. These props are computed and detect an 'edit mode' boolean that changes accordingly. The "propSet" defines the following form input props: color, filled, dense, outlin ...

What are the steps to integrate mp3 music into my web application?

Does anyone have experience implementing auto-resume mp3 music on a web application so that the music continues to play even when the user changes pages? I would like the music to seamlessly play as the user navigates through my web application. Can someo ...

Issue with the message deletion feature in discord.js

I am encountering an issue with the delete function in discord.js. My code is meant to deduct 1 point from a user's balance when an image is deleted from a channel. The problem arises when I try to delete another image that I uploaded - instead of ded ...

When the user clicks on an image, passing either the image name or image ID attribute

I need to send the image name to store.php whenever a user clicks on the image. Once I have the image name, I will query the database and display the corresponding result. However, I am unsure how to pass the image name when the user clicks on it. Can so ...

Obtaining the data stored in objects within a parse database

I'm currently facing an issue where I am trying to retrieve the name of the creator from the session object, which is a pointer. For testing purposes, I have been attempting to access this information but it keeps showing up as undefined. Any suggesti ...

Unable to Remove parentNode Class

I'm looking to eliminate a class from the parent <span> of the current node, which I have named "rows". When I view rows.parentNode in the console, it shows DOMTokenList["checked"]. How can I go about removing the checked class from it? I attem ...

Select an item from the options available

Looking to automatically select a specific item from a combobox upon clicking a button on my webpage. The page includes both PHP and JavaScript code for this functionality. Currently, I have a JavaScript function triggered by the "onclick" event of the bu ...

Place the simulation nodes in designated locations

Is there a proper way to position nodes at specific coordinates using simulation force in D3.js? I am trying to place nodes at specific positions with forceX/Y simulation in D3.js. My understanding is that setting the strength to 0 should result in no for ...

Is it necessary to link event handlers to `this` when using TypeScript and React?

One issue I encountered was with a component's button handler method. If the onClick handler is not bound to this in the constructor or inline on the onClick itself, an error occurs because the context of the handleAdd method is not tied to the instan ...

"A common error that may occur in Node.js is the inability to set headers after they have

I have encountered an issue while working on my node js application. I can load the page successfully once, but then I start getting an error message saying "Can't set headers after they are sent". If anyone has any suggestions or advice on how to re ...

Retrieving video information using Dailymotion API with JSON and jQuery

I have been struggling to understand the issue even after consulting the Dailymotion API and various sources. I am attempting to retrieve data from Dailymotion for a specific video ID by using the following code: $.getJSON('https://api.dailymotion.co ...