[go: nahoru, domu]

Skip to content

Commit

Permalink
Added forward and backward audio features
Browse files Browse the repository at this point in the history
  • Loading branch information
isaac.silva committed Jun 7, 2021
1 parent 5462d0c commit 90c314f
Show file tree
Hide file tree
Showing 7 changed files with 79,756 additions and 41 deletions.
76,142 changes: 76,140 additions & 2 deletions label_studio/frontend/dist/react-app/index.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion label_studio/frontend/dist/react-app/index.js.map

Large diffs are not rendered by default.

3,556 changes: 3,555 additions & 1 deletion label_studio/frontend/dist/react-app/main.css

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion label_studio/frontend/dist/react-app/main.css.map

Large diffs are not rendered by default.

67 changes: 33 additions & 34 deletions label_studio/frontend/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 4 additions & 2 deletions label_studio/frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@
"terser-webpack-plugin": "^5.1.1",
"typescript": "^4.2.2",
"webpack": "^5.21.2",
"webpack-cli": "^4.5.0"
"webpack-cli": "^4.7.0"
},
"babel": {
"presets": [
Expand Down Expand Up @@ -116,7 +116,9 @@
"<rootDir>/test/integration/**/*.test.ts",
"<rootDir>/test/integration/**/*.test.tsx"
],
"setupFilesAfterEnv": ["expect-puppeteer"]
"setupFilesAfterEnv": [
"expect-puppeteer"
]
},
{
"displayName": "unit",
Expand Down
22 changes: 22 additions & 0 deletions label_studio/frontend/src/providers/RoutesProvider.js
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,28 @@ export const RoutesProvider = ({children}) => {
console.log("Location changed");
const ContextComponent = lastRoute?.context;

// WARNING - The code below must be removed when we know how to change the frontend in the correct way.
const AUDIO_INJECTION_TIMEOUT = 3000
setTimeout(() => {
console.log('Inject audio control')
let wav = document.querySelector("#wave")

if(wav){
function my_key(e) {
let audioTag = document.querySelector("#wave>audio")
let time = 0.5
if (e.key === 'ArrowLeft') {
audioTag.currentTime -= time
}
if (e.key === 'ArrowRight') {
audioTag.currentTime += time
}
}
document.removeEventListener('keyup', my_key, false);
document.addEventListener('keyup', my_key, false);
}
}, AUDIO_INJECTION_TIMEOUT)

setCurrentContext({
component: ContextComponent ?? null,
props: currentContextProps,
Expand Down

0 comments on commit 90c314f

Please sign in to comment.