Is there a way to reset .bind(“ended”) for audio/video players in Javascript?

64
August 01, 2021, at 8:30 PM

I am very new to javascript. I have a function that activates only when some media (audio or video) is played. I use .bind("ended") to activate the function. The only problem is, after I activate the function, I would like to reset the players so that it seems as if they haven't been played before.

It is part of an experiment with a series of trials, and in each trial the answers should only be presented to participants after they have played the media. The only problem is sometimes the same media appears multiple times in different trials, so if they have played the media on a previous trial, they will see the answers immediately. I want to be able to reset the players at the end of each trial so that they are not "ended", so I don't have this problem.

$('#realplayer-'+trialOrder[curTrial]).bind("ended", function(){
  $('#foilplayer-'+trialOrder[curTrial]).bind("ended",showanswers)
});
$('#foilplayer-'+trialOrder[curTrial]).bind("ended", function(){
  $('#realplayer-'+trialOrder[curTrial]).bind("ended",showanswers)
});

Let me know if you can help!

READ ALSO
How to create a confusion matrix for VGG16 image calssification (2 options) when using preprocessing.image_dataset_from_directory

How to create a confusion matrix for VGG16 image calssification (2 options) when using preprocessing.image_dataset_from_directory

I have been trying to create a confusion matrix to test my data on from my VGG16 classification model (python 38, using Keras)

151
I can't link the information from a database into my php document

I can't link the information from a database into my php document

I'm trying to make an online shop for my school canteen (this is a school assignment) and I'm really struggling with linking items from the database I've created into my PHP document

84
How do I turn my website into an app when adding to homescreen on an ios device?

How do I turn my website into an app when adding to homescreen on an ios device?

I have a website and I would like for it to be an app, take as an example the samsung itest which prompts you to add to the home screen on an ios device, how would I implement such a thing and then make it work as a fullscreen app?

63
Align Images To The Right Within a Table Data (td) Cell

Align Images To The Right Within a Table Data (td) Cell

I have a <td> img element within my react-bootstrap table that I want to align to the rightCurrently, it's set to have a marginLeft of 10px after the text to the left (see picture) but I would like all the imgs to be consistent in a single "column"...

115