mirror of
https://github.com/seigler/HLS-over-IPFS-video-player
synced 2025-07-26 01:06:15 +00:00
fix: bugs
This commit is contained in:
parent
1b49b532dc
commit
c853faf3ca
2 changed files with 6 additions and 10 deletions
|
@ -7,7 +7,7 @@
|
|||
"license": "MIT",
|
||||
"scripts": {
|
||||
"clean": "rimraf ./dist ./.cache ./.parcel-cache",
|
||||
"build": "parcel build index.html --no-scope-hoist --public-url ./",
|
||||
"build": "parcel build index.html --no-scope-hoist --public-url ./ && echo ipfsvideo.cc > ./dist/CNAME",
|
||||
"serve": "parcel serve index.html --open -p 8888",
|
||||
"start": "npm run serve",
|
||||
"test": "npm run build && playwright test tests --browser=firefox --retries=3",
|
||||
|
|
14
src/index.js
14
src/index.js
|
@ -52,26 +52,22 @@ document.addEventListener('DOMContentLoaded', async () => {
|
|||
menu.style.top = e.pageY + 'px'
|
||||
e.preventDefault()
|
||||
}
|
||||
background.onClick = e => {
|
||||
background.onclick = e => {
|
||||
e.stopPropagation()
|
||||
background.classList.toggle('is-hidden')
|
||||
}
|
||||
const url = `http://ipfsvideo.cc?hash=${
|
||||
hash
|
||||
}${
|
||||
title && '&title=' + encodeURIComponent(title)
|
||||
(title && '&title=' + encodeURIComponent(title))||''
|
||||
}${
|
||||
source && '&source=' + encodeURIComponent(source)
|
||||
(source && '&source=' + encodeURIComponent(source))||''
|
||||
}`
|
||||
document.getElementById('contextMenu-url').onClick = e => {
|
||||
e.stopPropagation()
|
||||
document.getElementById('contextMenu-url').onclick = e => {
|
||||
navigator.clipboard.writeText(url)
|
||||
background.classList.toggle('is-hidden')
|
||||
}
|
||||
document.getElementById('contextMenu-urlWithTime').onClick = e => {
|
||||
e.stopPropagation()
|
||||
document.getElementById('contextMenu-urlWithTime').onclick = e => {
|
||||
navigator.clipboard.writeText(`${url}&time=${Math.round(video.currentTime)}`)
|
||||
background.classList.toggle('is-hidden')
|
||||
}
|
||||
}
|
||||
})
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue