Can anyone help me figure out how to overlay a link over a video playing at a specific time on an HTML page?
I know it's easy to do on Youtube, but I need to accomplish this task without using Youtube. :)
Thank you in advance for any assistance!
Can anyone help me figure out how to overlay a link over a video playing at a specific time on an HTML page?
I know it's easy to do on Youtube, but I need to accomplish this task without using Youtube. :)
Thank you in advance for any assistance!
There are numerous methods to accomplish this task.
One straightforward approach involves using the setInterval
function. The link will be displayed after 3 seconds of the video playing.
var video = document.querySelector('video'),
link = document.querySelector('a'),
timer = document.querySelector('#timer');
setInterval(function() {
if (video.currentTime > 3 && video.currentTime < 6) {
link.style.display = 'block';
}
else {
link.style.display = 'none';
}
timer.textContent = video.currentTime;
}, 100);
.wrapper {
position:relative;
}
a {
position:absolute;
top:10px;
left:10px;
background:rgba(0,0,0,0.8);
color:#fff;
display:none;
}
<div class="wrapper">
<video width="320" height="240" controls>
<source src="http://www.w3schools.com/html/mov_bbb.mp4" type="video/mp4">
</video>
<a href="http://google.com" target="_blank">Here is your link</a>
</div>
<div>Current time: <span id="timer"></span></div>
Is there a way to specify a photometric function in Three.js? Currently, I am utilizing a Lambert material: new THREE.MeshLambertMaterial({ color: 0xffffff }) However, I am interested in using a Lommel Seeliger but I am unsure of the process and locatio ...
We are currently managing multiple animations on the same object and need to execute different actions once each animation is complete. At present, we listen for the webkitAnimationEnd event and use a complex if/then statement to handle each animation sep ...
Many others have encountered a similar issue, but I'm struggling to resolve it. Every time I open VSCode, I find myself needing to run these commands in the terminal for npx, npm, and nvm to work: export NVM_DIR="$HOME/.nvm" [ -s "$NVM_DIR/nvm.sh" ] ...
I have a simple HTML input field with JavaScript functionality, which includes a checkbox. I am trying to write text in the input field when the checkbox is checked, and make the input field read-only when it is not checked. Can anyone provide an example ...
I'm currently working on a project that involves displaying and hiding a lot of content dynamically using ng-show. Some of the expressions being evaluated are quite lengthy, like this... <div ng-show="some.object.with.nested.values && ...
Within my grid view, there exists a column labeled remark. This specific field contains various values, one of which is absence. My objective is to modify the remark value exclusively when it is equal to absence, followed by clicking the corresponding icon ...
Currently, I am attempting to showcase a docx file on my webpage by converting it to HTML and then displaying it. However, this method generates CSS with rules that end up impacting the entire document. For instance, it changes all links to blue which co ...
I'm currently working on a website that requires implementing a chat feature. The project is running locally, but I've encountered an error: SyntaxError: Unexpected end of JSON input Despite searching online for a solution, nothing seems to w ...
I am trying to create a search form that will display users (username, firstname, or lastname) from my database as the user types, similar to how Facebook and Twitter do it. However, when I click on the search button, nothing happens. Below are two parts o ...
Currently, I am facing an issue with obtaining image data from a camera and photo album on a mobile device. Although I have successfully retrieved the chosen image using the provided code snippet below, my dilemma lies in transferring this image data to an ...
I need to query multiple collections in MongoDB. Here is an example of the data structure: Collection stops { { stop_id : 1, stop_name: 'a'}, { stop_id : 2, stop_name: 'b'}, ... Collection stop_time { { stop_id : 1, trip_i ...
> Here is an example of HTML code <label>Person</label> <input name="PersonID" type="text" id="PersonID"> <label>Car Plate Number</label> <input name="PersonsCarPlateNumber" list="PersonsCarPlateNumbe ...
Despite finding numerous posts addressing this issue, I am still encountering problems with my code: <div id="product_tabs_description_tabbed_contents" style="display: block;"><img style="margin-left: -10px; opacity: 1 !important;" src="{{media u ...
Could you please review the code below and help me understand why I am unable to retrieve the ID of the selected radio buttons using this.id? <div id="pay" class="btn-group" data-toggle="buttons"> <label class="btn btn-primary"> < ...
Struggling to find a way to remove a substring within an angular expression while using the ng-repeat directive. The controller resides in an external JavaScript file, and here is the corresponding HTML code snippet. function myController($scope, $http ...
While attempting to filter unique dates, I've noticed that the output varies. In some cases, it works correctly, while in others, it does not. I'm having trouble figuring out what's causing this inconsistency. The filtering method below gene ...
(click) event in one instance of a component is causing the function in another instance to be triggered unexpectedly. I am having trouble describing this issue. For reference, I have included a working example on stackblitz. When clicking on both buttons ...
Trying to figure out how to set a div in HTML and then have a second div take up the remaining space. It seems like it should be simple, but I'm struggling with it. I'd like to have a div with a fixed height and then have another div take up the ...
I'm facing an issue while trying to integrate SSR into my project. I keep encountering this error/warning. How can I pinpoint the problem in my code? There are numerous components in my project, so I'm unsure if I should share all of my code, b ...
I've been struggling to make this work for some time and was hoping for some guidance. OBJECTIVE: I'm attempting to sort the posts by the number of likes they currently have. CURRENT: const posts = await db.post.findAll({ include: [ db.user ...