R
R
Rinat Haisman2019-03-03 22:57:14
JavaScript
Rinat Haisman, 2019-03-03 22:57:14

Wordpress: how to play and pause video on hover?

Actually, subject.
I want to do exactly as it is done by: https://www.alomoves.com

Answer the question

In order to leave comments, you need to log in

4 answer(s)
D
Dima Polos, 2019-03-03
@dimovich85

WP has nothing to do with it.
Write in js:

let video = document.querySelector('video');
video.addEventListener('mouseover', e=>{e.target.pause()});
video.addEventListener('mouseout', e=>{e.target.play()});

As for the js itself, look in the theme folder.

I
IgorVol, 2017-07-26
@IgorVol

Who cares. I use nginx upstream, the weakest VPS (1CP/10 GB SSD/1 GB RAM) handles proxying. The bottleneck is the channel width (~50 Mbit/s), I had to expand it for money (well, disable the nginx logs because of the 10 GB zisk). Renting a server for proxying would be ~2 times more expensive, so the savings are small and it's better to rent a server. But nginx upstream itself works great!

H
hatiko, 2016-10-18
@hatiko

Depending on the task:
haproxy, nginx, squid....
But you WILL NOT BE ABLE TO SHARED THE LOAD IN SEPARATE SERVERS if you just take VPS/VDS.
Since the input channel and the output channel are the same for them.
You will EVEN WORSE the situation - increase the load on the first server (proxy) in the chain. Since, in addition to incoming connections, it will also be forced to process outgoing connections to child servers. And there is only one channel ....
To do it normally, you need to take a group of servers along with an internal network service between them, so that one channel goes outside, and a completely different one inside. And these are not cheap rates.
I would just put one powerful server and optimize the software.
If your goals allow the task to be delayed and the load is not uniform, then the situation is simpler - and, indeed, you can get by with a lot of VPS / VDS.
If we are talking only about media files, then, for sure, cloud storage (such as S3, etc.) or your own iron (dedicated) server will be much better.

A
Alexey, 2016-10-17
@alsopub

VPS == VDS
Depending on your goals, workload and budget, you need either a VPS (several) or a CDN or a dedicated server (possibly several).

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question