Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(FEC-13945): move core controls to upper bar #59

Merged
merged 8 commits into from
Jul 16, 2024
Merged

Conversation

lianbenjamin
Copy link
Contributor

@lianbenjamin lianbenjamin commented Jun 27, 2024

Description of the Changes

following a new requirement to move core controls to the upper bar, in case there is not enough space for them:

  • add a new manager that adds controls to the upper bar, according to redux state
  • address design requirements for the More drop-down menu component:
    • trim text if theres is not enough space
    • add tooltip around the text if it is trimmed

related PR- kaltura/playkit-js-ui#898

Solves FEC-13945

CheckLists

  • changes have been done against master branch, and PR does not conflict
  • new unit / functional tests have been added (whenever applicable)
  • test are passing in local environment
  • Travis tests are passing (or test results are not worse than on master branch :))
  • Docs have been updated

Copy link
Contributor

@JonathanTGold JonathanTGold left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why bott

@@ -14,8 +14,9 @@ export class IconModel {
public componentRef: RefObject<IconWrapper>;
public onClick: (e: MouseEvent | KeyboardEvent) => void;
public component: ComponentClass<Record<string, never>> | FunctionalComponent<Record<string, never>>;
public svgIcon: SvgIcon;
public svgIcon: SvgIcon | (() => SvgIcon);
Copy link
Contributor

@JonathanTGold JonathanTGold Jul 10, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why it should be a function?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the controls that I handled (PiP, CC, AAD, etc..) have 2 possible icons, which depends on the system's state. Hence, I added to the type a function that returns the SvgIcon.

@@ -0,0 +1,58 @@
import { KalturaPlayer, Logger, ui } from '@playkit-js/kaltura-player-js';
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if it is only for core controls, it is better call it something like core-controls-bars-mangerer

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hmmm not sure, i mean, right now it is for core controls but what if in the future it will be for others as well?

@@ -27,6 +28,7 @@ export class IconModel {
this.componentRef = createRef();
this.presets =
item.presets && item.presets.length > 0 ? item.presets : [ReservedPresetNames.Playback, ReservedPresetNames.Live];
this.shouldHandleOnClick = typeof item.shouldHandleOnClick === 'boolean' ? item.shouldHandleOnClick : true;
Copy link
Contributor

@JonathanTGold JonathanTGold Jul 10, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why do we need this ? why just check if on click is supplied or not

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the new shouldHandleOnClick flag is indicating whether the upper bar should call the icon's onClick or not.
the reason is that the controls i handled to move to the upper bar (PiP, CC, AAD, etc..) are not only icons like the vamb plugin icons- they are actually the component itself; the way they behave in bottom bar- same in upper bar. which means, they have their own states and handlers.

another explanation:
let's say we don't have that flag, then the onClick will happen twice- 1 time from within the component and 1 time from the upper bar. Thus, the solution for this issue was to tell the upper bar- "I can handle myself, don't trigger my onClick".

Copy link
Contributor

@JonathanTGold JonathanTGold left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@lianbenjamin did you remove/change the old mechanisem (bottem bar manger) from core or you count on it ?

@lianbenjamin
Copy link
Contributor Author

@lianbenjamin did you remove/change the old mechanisem (bottem bar manger) from core or you count on it ?

did not change the mechanism of the bottom bar- totally using it and counting on it. the only extra thing that the bottom bar is doing now, is updating a new redux state to keep the controls which will be removed from the bottom bar (and will be moved to the upper bar).

MosheMaorKaltura pushed a commit to kaltura/playkit-js-ui that referenced this pull request Jul 16, 2024
### Description of the Changes

**New requirement:**
if there is not enough space for controls in bottom bar, instead of
removing them- move them to the upper bar.
This was requested for A11y purposes.

- keep 10sec FWD and BWD controls in bottom bar (do not remove them)
- new service to register relevant core components
- new redux state to update the controls that need to be moved from
bottom bar to upper bar
- new interface that registers the components to the new service
- a special implementation for `TimeDisplay` component (different
behavior)

related PR: kaltura/playkit-js-ui-managers#59

#### Resolves FEC-13945
@MosheMaorKaltura MosheMaorKaltura merged commit 1db6d1b into master Jul 16, 2024
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

4 participants