-
-
Notifications
You must be signed in to change notification settings - Fork 130
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
video_volume.js
will keep all the players volume in sync
#166
Open
Znuff
wants to merge
5
commits into
pablouser1:master
Choose a base branch
from
Znuff:master
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
3c03306
`video_volume.js` will keep all the players volume in sync
Znuff 4d4f4d5
Adding volume script to the hero template
Znuff 6fc05ec
Merge branch 'master' of https://github.com/pablouser1/ProxiTok
Znuff f8ee2d8
Improved embedding
Znuff 4808757
ensuring iframe plays on click
Znuff File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,7 +3,10 @@ version: '3' | |
services: | ||
web: | ||
container_name: proxitok-web | ||
image: ghcr.io/pablouser1/proxitok:master | ||
#image: ghcr.io/pablouser1/proxitok:latest | ||
build: | ||
context: ./ | ||
dockerfile: ./Dockerfile | ||
ports: | ||
- 8080:8080 | ||
environment: | ||
|
@@ -22,8 +25,8 @@ services: | |
- proxitok | ||
security_opt: | ||
- no-new-privileges:true | ||
cap_drop: | ||
- ALL | ||
#cap_drop: | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why are you commenting out this? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It was breaking the Apache container previously. Again, the |
||
# - ALL | ||
cap_add: | ||
- CHOWN | ||
- SETGID | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
// This will save the video volume and keep all the players on the page in sync | ||
document.addEventListener("DOMContentLoaded", function() { | ||
const videos = document.querySelectorAll("video"); | ||
|
||
// Function to save the volume to localStorage | ||
function saveVolume(volume) { | ||
localStorage.setItem("videoVolume", volume); | ||
} | ||
|
||
// Function to restore the volume from localStorage | ||
function restoreVolume() { | ||
const savedVolume = localStorage.getItem("videoVolume"); | ||
if (savedVolume !== null) { | ||
videos.forEach(video => { | ||
video.volume = parseFloat(savedVolume); | ||
}); | ||
} | ||
} | ||
|
||
// Function to sync the volume across all video elements | ||
function syncVolume(video) { | ||
videos.forEach(otherVideo => { | ||
if (otherVideo !== video) { | ||
otherVideo.volume = video.volume; | ||
} | ||
}); | ||
saveVolume(video.volume); | ||
} | ||
|
||
// Loop through all video elements and attach event listeners | ||
videos.forEach(video => { | ||
// Save the volume when the volume changes | ||
video.addEventListener("volumechange", function() { | ||
syncVolume(video); | ||
}); | ||
}); | ||
|
||
// Restore the volume on page load | ||
restoreVolume(); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,26 @@ | ||
.new-line { | ||
white-space: pre-wrap; | ||
} | ||
|
||
html.embed { | ||
overflow: hidden; | ||
background-color: rgba(0,0,0,0); | ||
} | ||
|
||
.embed-page { | ||
display: flex; | ||
align-items: center; | ||
justify-content: center; | ||
} | ||
|
||
.embed-page .embed-video { | ||
width: 100%; | ||
height: 100%; | ||
} | ||
|
||
.embed-video video { | ||
height: 100vh; | ||
max-height: 100vh; | ||
width: 100%; | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,26 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
|
||
<html lang="en" class="embed"> | ||
{include '../components/head.latte'} | ||
|
||
<body> | ||
{block content}{/block} | ||
{block extra}{/block} | ||
<div class="embed-page"> | ||
<div class="embed-video"> | ||
{include '../components/themes/common/content.latte', item: $item, isAutoplay: true, isBig: true} | ||
</div> | ||
</div> | ||
|
||
<script src="{static('js', 'video_volume.js')}"></script> | ||
<script> | ||
// allow clickable play/pause when embedded | ||
document.addEventListener("DOMContentLoaded", function () { | ||
document.querySelector('video').addEventListener("click", function () { | ||
if (video.paused) { | ||
video.play(); | ||
} else { | ||
video.pause(); | ||
} | ||
}); | ||
}); | ||
</script> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You should let docker-compose use the pre-built image, maybe you were doing some testing and forgot to undo it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Obviously, how else could I test? It's just Github automatically picking up the
docker-compose
changes, this wasn't meant to make it in the PR