Skip to content

Commit

Permalink
Merge pull request #6 from cern-vc/develop
Browse files Browse the repository at this point in the history
🚀 Bump to 0.2.3
  • Loading branch information
SamuelGuillemet authored Aug 11, 2023
2 parents c6103ec + 34fa20c commit e0e6836
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 9 deletions.
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,9 @@ To test the plugins, you need to run the following command:
$ npm run dev
```

Go to `http://localhost:8090/?id=test-video` to test the plugins.
Go to `http://localhost:8090/?id=test-video` to test the plugins. You will maybe need to chnages parameters in the url to test the plugins.

For example to test the **nextTimeButtonPlugin** and the **prevTimeButtonPlugin**, you need to add the following parameters to the url: `&time=3m,4m,5m`.

---

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@cern-vc/cern-paella-plugins",
"version": "0.2.2",
"version": "0.2.3",
"description": "Paella plugins for cern use",
"main": "src/index.js",
"module": "dist/cern-paella-plugins.js",
Expand Down
6 changes: 3 additions & 3 deletions src/plugins/ch.cern.paella.nextTimeButtonPlugin.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,13 +55,13 @@ export default class NextTimeButtonPlugin extends ButtonPlugin {
const addSuffix =
this.config.suffix !== undefined ? this.config.suffix : true;
this.suffix = addSuffix ? "s" : "";
this.icon = `<img src="${defaultForwardIcon}"/>`;
this.icon = defaultForwardIcon;
setTimeout(() => {
Array.from(this.iconElement.getElementsByClassName("time-text")).forEach(
(textIcon) => {
// eslint-disable-next-line no-param-reassign
textIcon.innerHTML = this.time + this.suffix;
},
}
);
}, 100);
}
Expand All @@ -74,7 +74,7 @@ export default class NextTimeButtonPlugin extends ButtonPlugin {
}
this.time = this.slots[this.player.currentPosition];
console.log(
`Jump to next time: ${this.time}. Slot ${this.player.currentPosition}`,
`Jump to next time: ${this.time}. Slot ${this.player.currentPosition}`
);
// const currentTime = await this.player.videoContainer.currentTime();
this.player.videoContainer.setCurrentTime(this.time);
Expand Down
8 changes: 4 additions & 4 deletions src/plugins/ch.cern.paella.prevTimeButtonPlugin.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { ButtonPlugin } from "paella-core";
import defaultIcon from "./icons/previous-icon.svg";
import defaultBackwardIcon from "./icons/previous-icon.svg";

const params = new Proxy(new URLSearchParams(window.location.search), {
get: (searchParams, prop) => searchParams.get(prop),
Expand Down Expand Up @@ -56,13 +56,13 @@ export default class PrevTimeButtonPlugin extends ButtonPlugin {
const addSuffix =
this.config.suffix !== undefined ? this.config.suffix : true;
this.suffix = addSuffix ? "s" : "";
this.icon = `<img src="${defaultIcon}"/>`;
this.icon = defaultBackwardIcon;
setTimeout(() => {
Array.from(this.iconElement.getElementsByClassName("time-text")).forEach(
(textIcon) => {
// eslint-disable-next-line no-param-reassign
textIcon.innerHTML = this.time + this.suffix;
},
}
);
}, 100);
}
Expand All @@ -75,7 +75,7 @@ export default class PrevTimeButtonPlugin extends ButtonPlugin {
}
this.time = this.slots[this.player.currentPosition];
console.log(
`Jump to previous time: ${this.time}. Slot ${this.player.currentPosition}`,
`Jump to previous time: ${this.time}. Slot ${this.player.currentPosition}`
);
this.player.videoContainer.setCurrentTime(this.time);
}
Expand Down

0 comments on commit e0e6836

Please sign in to comment.