Skip to content

Commit

Permalink
ebay-video: added ability to input shaka config (eBay#2306)
Browse files Browse the repository at this point in the history
  • Loading branch information
JereMIbq1995 authored Oct 30, 2024
1 parent 6ecb144 commit 047647b
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/weak-lemons-dance.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@ebay/ebayui-core": patch
---

ebay-video: shaka config can now be added as input
2 changes: 2 additions & 0 deletions src/components/ebay-video/component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ interface VideoInput extends Omit<Marko.Input<"video">, `on${string}`> {
"on-pause"?: (event: PlayPauseEvent) => void;
"on-volume-change"?: (event: VolumeEvent) => void;
"on-load-error"?: (err: Error) => void;
"shaka-config"?: any;
}

export interface Input extends WithNormalizedProps<VideoInput> {}
Expand Down Expand Up @@ -314,6 +315,7 @@ class Video extends Marko.Component<Input, State> {

// eslint-disable-next-line no-undef,new-cap
this.player = new shaka.Player(this.video);
this.player.configure(this.input.shakaConfig || {});
this._attach();

this._loadSrc();
Expand Down
12 changes: 11 additions & 1 deletion src/components/ebay-video/video.stories.ts
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,11 @@ export default {
description:
"True/False to keep or remove volume slider. Default is False",
},
shakaConfig: {
description:
"The Shaka player [configuration object](https://shaka-player-demo.appspot.com/docs/api/tutorial-config.html). This allows users to control Shaka player.",
control: { type: "object" },
},

source: {
name: "@source",
Expand Down Expand Up @@ -228,7 +233,7 @@ Standard.args = {
src: "https://ir.ebaystatic.com/cr/v/c1/ebayui/video/v1/playlist.mpd",
type: "dash",
},
],
]
};
Standard.parameters = {
docs: {
Expand All @@ -253,6 +258,11 @@ ios.args = {
type: "dash",
},
],
shakaConfig: {
streaming: {
lowLatencyMode: true,
}
}
};

ios.parameters = {
Expand Down

0 comments on commit 047647b

Please sign in to comment.