-
Notifications
You must be signed in to change notification settings - Fork 0
/
willhazell.js
75 lines (59 loc) · 2.09 KB
/
willhazell.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
// JS WH_05.02.2021
// Plyr
const players = Array.from(document.querySelectorAll(".projectfilm")).map(player => new Plyr(player,{
muted: false,
autoplay: false,
hideControls: true,
loop:{ active: 'true'},
fullscreen: { iosNative: 'true'},
debug: true,
vimeo: {
muted: false,
loop: true,
autoplay: false,
byline: false,
portrait: false,
title: false,
speed: false,
transparent: false,
controls: false },
controls: [
'play-large', //big one
'play', // Extra one for hacks
'play', // Play/pause playback
'progress', // The progress bar and scrubber for playback and buffering
'current-time', // The current time of playback
'duration', // The full duration of the media
'captions', // Toggle captions
'volume',
'fullscreen', // Toggle fullscreen
'download',
]}));
Webflow.push(function() {
players.forEach(function(player) {
player.on('play',function(){
$(".plyr__video-wrapper").attr( "style","visibility: visible"),
$(".plyr__controls").attr( "style","visibility: visible"),
$(".VimeoPlyrPreviewWrapper").attr( "style","visibility: hidden")
});
});
players.forEach(function(player) {
player.on('pause',function(){
$(".plyr__video-wrapper").attr( "style","visibility: hidden"),
$(".plyr__controls").attr( "style","visibility: hidden"),
$(".VimeoPlyrPreviewWrapper").attr( "style","visibility: visible")
});
});
});
// Expose player so it can be used from the console
//window.player = player;
// fq player hide/show
// fq Archive Image Hover
Webflow.push(function() {
// Hover image change
$('img[data-hover-image]').hover(function() {
var el = $(this); el.attr('data-hover-original-image', el.attr('src')).attr('src', el.attr('data-hover-image'));
}, function() {
var el = $(this); el.attr('src', el.attr('data-hover-original-image'));
});
});