Skip to content

Commit

Permalink
add readme anchors, prevent rightclick action in ruttetra, fix broken…
Browse files Browse the repository at this point in the history
… youtube logic and tests
  • Loading branch information
eyaler committed Sep 30, 2024
1 parent 5e20a75 commit bcd5030
Show file tree
Hide file tree
Showing 4 changed files with 57 additions and 54 deletions.
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,16 @@ The code demos usages with Wasm ([MediaPipe](https://ai.google.dev/edge/mediapip
WebGPU ([TensorFlow.js](https://www.tensorflow.org/js), [ONNX Runtime Web](https://onnxruntime.ai/docs/get-started/with-javascript/web.html), [Transformers.js](https://huggingface.co/docs/transformers.js/index)),
WebGL ([Three.js](https://threejs.org/), [SwissGL](https://google.github.io/swissgl/)), and VanillaJS.

Known issues:
#### Known issues:
1. Resolution of captured media is doubled for smaller frames: https://github.com/screen-share/element-capture/issues/44

<br>

#### Demo Video:

[Demo video](https://github.com/eyaler/LordTubeMaster/assets/4436747/2352969c-889d-478e-b386-8bdf6452a797)

<br>
High-level architecture and modules:

#### High-level architecture and modules:
![Architecture](media/LordTubeMaster.svg)
2 changes: 1 addition & 1 deletion models/ruttetraizer.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ export default class RuttEtraIzer {
vertexColors: true,
})

canvas.addEventListener('pointerdown', e => {down_x = e.clientX; down_y = e.clientY})
canvas.addEventListener('pointerdown', e => {if (!e.button) {down_x = e.clientX; down_y = e.clientY}})

document.addEventListener('pointerup', () => down_x = down_y = null)

Expand Down
5 changes: 3 additions & 2 deletions utils/videoloader.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,10 @@ export default function load_video(input, video_elem) {

let url = 'about:blank'
let hash = ''
if (host.includes('vimeo') || vid_id.match(/^\d+\/?\w*$/) || vid_id2.match(/^\d+\/?\w*$/)) { // Vimeo
if (!vid_id.match(/^\d+$/))
if (host.includes('vimeo') || vid_id.match(/^\d+(\/\w+)?$/) || vid_id2.match(/^\d+(\/\w+)?$/)) { // Vimeo
if (!vid_id.match(/^\d+$/)) {
vid_id = vid_id2
}
if (vid_id.includes('/')) {
let secret
[vid_id, secret] = vid_id.split('/')
Expand Down
98 changes: 49 additions & 49 deletions utils/videoloader_tests/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,58 +2,58 @@ import load_video from '../videoloader.js'

const tests = {
'': '',
'KxGRhd_iWuE': `
https://www.youtube.com/watch?v=KxGRhd_iWuE
https://www.youtube-nocookie.com/watch?v=KxGRhd_iWuE
https://www.youtube.com/embed/KxGRhd_iWuE
https://www.youtube-nocookie.com/embed/KxGRhd_iWuE
https://youtu.be/KxGRhd_iWuE
www.youtube.com/watch?v=KxGRhd_iWuE
www.youtube-nocookie.com/watch?v=KxGRhd_iWuE
www.youtube.com/embed/KxGRhd_iWuE
www.youtube-nocookie.com/embed/KxGRhd_iWuE
youtu.be/KxGRhd_iWuE
KxGRhd_iWuE
?v=KxGRhd_iWuE
&v=KxGRhd_iWuE
v=KxGRhd_iWuE
'59bH4FhOVkA': `
https://www.youtube.com/watch?v=59bH4FhOVkA
https://www.youtube-nocookie.com/watch?v=59bH4FhOVkA
https://www.youtube.com/embed/59bH4FhOVkA
https://www.youtube-nocookie.com/embed/59bH4FhOVkA
https://youtu.be/59bH4FhOVkA
www.youtube.com/watch?v=59bH4FhOVkA
www.youtube-nocookie.com/watch?v=59bH4FhOVkA
www.youtube.com/embed/59bH4FhOVkA
www.youtube-nocookie.com/embed/59bH4FhOVkA
youtu.be/59bH4FhOVkA
59bH4FhOVkA
?v=59bH4FhOVkA
&v=59bH4FhOVkA
v=59bH4FhOVkA
`,
'KxGRhd_iWuE&playlist=KxGRhd_iWuE': `
https://www.youtube.com/watch?v=KxGRhd_iWuE&playlist=KxGRhd_iWuE
https://www.youtube.com/watch?playlist=KxGRhd_iWuE&v=KxGRhd_iWuE
https://www.youtube.com/embed/KxGRhd_iWuE?playlist=KxGRhd_iWuE
www.youtube.com/watch?v=KxGRhd_iWuE&playlist=KxGRhd_iWuE
www.youtube.com/watch?playlist=KxGRhd_iWuE&v=KxGRhd_iWuE
www.youtube.com/embed/KxGRhd_iWuE?playlist=KxGRhd_iWuE
?v=KxGRhd_iWuE&playlist=KxGRhd_iWuE
&v=KxGRhd_iWuE&playlist=KxGRhd_iWuE
v=KxGRhd_iWuE&playlist=KxGRhd_iWuE
KxGRhd_iWuE&playlist=KxGRhd_iWuE
?playlist=KxGRhd_iWuE&v=KxGRhd_iWuE
&playlist=KxGRhd_iWuE&v=KxGRhd_iWuE
playlist=KxGRhd_iWuE&v=KxGRhd_iWuE
'59bH4FhOVkA&playlist=59bH4FhOVkA': `
https://www.youtube.com/watch?v=59bH4FhOVkA&playlist=59bH4FhOVkA
https://www.youtube.com/watch?playlist=59bH4FhOVkA&v=59bH4FhOVkA
https://www.youtube.com/embed/59bH4FhOVkA?playlist=59bH4FhOVkA
www.youtube.com/watch?v=59bH4FhOVkA&playlist=59bH4FhOVkA
www.youtube.com/watch?playlist=59bH4FhOVkA&v=59bH4FhOVkA
www.youtube.com/embed/59bH4FhOVkA?playlist=59bH4FhOVkA
?v=59bH4FhOVkA&playlist=59bH4FhOVkA
&v=59bH4FhOVkA&playlist=59bH4FhOVkA
v=59bH4FhOVkA&playlist=59bH4FhOVkA
59bH4FhOVkA&playlist=59bH4FhOVkA
?playlist=59bH4FhOVkA&v=59bH4FhOVkA
&playlist=59bH4FhOVkA&v=59bH4FhOVkA
playlist=59bH4FhOVkA&v=59bH4FhOVkA
`,
'playlist=KxGRhd_iWuE': `
https://www.youtube.com/embed/?playlist=KxGRhd_iWuE
www.youtube.com/embed/?playlist=KxGRhd_iWuE
?playlist=KxGRhd_iWuE
&playlist=KxGRhd_iWuE
playlist=KxGRhd_iWuE
'playlist=59bH4FhOVkA': `
https://www.youtube.com/embed/?playlist=59bH4FhOVkA
www.youtube.com/embed/?playlist=59bH4FhOVkA
?playlist=59bH4FhOVkA
&playlist=59bH4FhOVkA
playlist=59bH4FhOVkA
`,
'KxGRhd_iWuE&list=PLZV8sKAO3LzbA18GxCub2j_2ZpwJENDAS': `
https://www.youtube.com/watch?v=KxGRhd_iWuE&list=PLZV8sKAO3LzbA18GxCub2j_2ZpwJENDAS
https://www.youtube.com/watch?list=PLZV8sKAO3LzbA18GxCub2j_2ZpwJENDAS&v=KxGRhd_iWuE
https://www.youtube.com/embed/KxGRhd_iWuE?list=PLZV8sKAO3LzbA18GxCub2j_2ZpwJENDAS
www.youtube.com/watch?v=KxGRhd_iWuE&list=PLZV8sKAO3LzbA18GxCub2j_2ZpwJENDAS
www.youtube.com/watch?list=PLZV8sKAO3LzbA18GxCub2j_2ZpwJENDAS&v=KxGRhd_iWuE
www.youtube.com/embed/KxGRhd_iWuE?list=PLZV8sKAO3LzbA18GxCub2j_2ZpwJENDAS
?v=KxGRhd_iWuE&list=PLZV8sKAO3LzbA18GxCub2j_2ZpwJENDAS
&v=KxGRhd_iWuE&list=PLZV8sKAO3LzbA18GxCub2j_2ZpwJENDAS
v=KxGRhd_iWuE&list=PLZV8sKAO3LzbA18GxCub2j_2ZpwJENDAS
KxGRhd_iWuE&list=PLZV8sKAO3LzbA18GxCub2j_2ZpwJENDAS
?list=PLZV8sKAO3LzbA18GxCub2j_2ZpwJENDAS&v=KxGRhd_iWuE
&list=PLZV8sKAO3LzbA18GxCub2j_2ZpwJENDAS&v=KxGRhd_iWuE
list=PLZV8sKAO3LzbA18GxCub2j_2ZpwJENDAS&v=KxGRhd_iWuE
'59bH4FhOVkA&list=PLZV8sKAO3LzbA18GxCub2j_2ZpwJENDAS': `
https://www.youtube.com/watch?v=59bH4FhOVkA&list=PLZV8sKAO3LzbA18GxCub2j_2ZpwJENDAS
https://www.youtube.com/watch?list=PLZV8sKAO3LzbA18GxCub2j_2ZpwJENDAS&v=59bH4FhOVkA
https://www.youtube.com/embed/59bH4FhOVkA?list=PLZV8sKAO3LzbA18GxCub2j_2ZpwJENDAS
www.youtube.com/watch?v=59bH4FhOVkA&list=PLZV8sKAO3LzbA18GxCub2j_2ZpwJENDAS
www.youtube.com/watch?list=PLZV8sKAO3LzbA18GxCub2j_2ZpwJENDAS&v=59bH4FhOVkA
www.youtube.com/embed/59bH4FhOVkA?list=PLZV8sKAO3LzbA18GxCub2j_2ZpwJENDAS
?v=59bH4FhOVkA&list=PLZV8sKAO3LzbA18GxCub2j_2ZpwJENDAS
&v=59bH4FhOVkA&list=PLZV8sKAO3LzbA18GxCub2j_2ZpwJENDAS
v=59bH4FhOVkA&list=PLZV8sKAO3LzbA18GxCub2j_2ZpwJENDAS
59bH4FhOVkA&list=PLZV8sKAO3LzbA18GxCub2j_2ZpwJENDAS
?list=PLZV8sKAO3LzbA18GxCub2j_2ZpwJENDAS&v=59bH4FhOVkA
&list=PLZV8sKAO3LzbA18GxCub2j_2ZpwJENDAS&v=59bH4FhOVkA
list=PLZV8sKAO3LzbA18GxCub2j_2ZpwJENDAS&v=59bH4FhOVkA
`,
'list=PLZV8sKAO3LzbA18GxCub2j_2ZpwJENDAS': `
https://www.youtube.com/embed/?list=PLZV8sKAO3LzbA18GxCub2j_2ZpwJENDAS
Expand Down

0 comments on commit bcd5030

Please sign in to comment.