mirror of
https://github.com/seigler/HLS-over-IPFS-video-player
synced 2025-07-27 01:36:14 +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",
|
"license": "MIT",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"clean": "rimraf ./dist ./.cache ./.parcel-cache",
|
"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",
|
"serve": "parcel serve index.html --open -p 8888",
|
||||||
"start": "npm run serve",
|
"start": "npm run serve",
|
||||||
"test": "npm run build && playwright test tests --browser=firefox --retries=3",
|
"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'
|
menu.style.top = e.pageY + 'px'
|
||||||
e.preventDefault()
|
e.preventDefault()
|
||||||
}
|
}
|
||||||
background.onClick = e => {
|
background.onclick = e => {
|
||||||
e.stopPropagation()
|
e.stopPropagation()
|
||||||
background.classList.toggle('is-hidden')
|
background.classList.toggle('is-hidden')
|
||||||
}
|
}
|
||||||
const url = `http://ipfsvideo.cc?hash=${
|
const url = `http://ipfsvideo.cc?hash=${
|
||||||
hash
|
hash
|
||||||
}${
|
}${
|
||||||
title && '&title=' + encodeURIComponent(title)
|
(title && '&title=' + encodeURIComponent(title))||''
|
||||||
}${
|
}${
|
||||||
source && '&source=' + encodeURIComponent(source)
|
(source && '&source=' + encodeURIComponent(source))||''
|
||||||
}`
|
}`
|
||||||
document.getElementById('contextMenu-url').onClick = e => {
|
document.getElementById('contextMenu-url').onclick = e => {
|
||||||
e.stopPropagation()
|
|
||||||
navigator.clipboard.writeText(url)
|
navigator.clipboard.writeText(url)
|
||||||
background.classList.toggle('is-hidden')
|
|
||||||
}
|
}
|
||||||
document.getElementById('contextMenu-urlWithTime').onClick = e => {
|
document.getElementById('contextMenu-urlWithTime').onclick = e => {
|
||||||
e.stopPropagation()
|
|
||||||
navigator.clipboard.writeText(`${url}&time=${Math.round(video.currentTime)}`)
|
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