Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function hoverVideo(i) {
- if (playingVideo == null) {
- jQuery('.wpst-trailer').attr('playsinline', true);
- }
- if (playingVideo && playingVideo != i) {
- hideVideo(playingVideo);
- } else if (playingVideo && playingVideo == i) {
- return;
- }
- playingVideo = i;
- var playPromise = jQuery('.wpst-trailer')[i].play();
- if (playPromise !== undefined) {
- playPromise.then(_ => {
- // Automatic playback started!
- // Show playing UI.
- })
- .catch(error => {
- // Auto-play was prevented
- // Show paused UI.
- });
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement