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

Feature/player style #1416

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion packages/rrweb-player/src/Player.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
} from './utils';
import Controller from './Controller.svelte';

export let playerClassName: string = '';
export let width = 1024;
export let height = 576;
export let maxScale = 1;
Expand Down Expand Up @@ -213,14 +214,16 @@
transform-origin: top left;
left: 50%;
top: 50%;
height: 100%;
}

.replayer-wrapper > iframe {
border: none;
height: 100%;
}
</style>

<div class="rr-player" bind:this={player} style={playerStyle}>
<div class="{['rr-player', playerClassName].join(' ').trim()}" bind:this={player} style={playerStyle}>
<div class="rr-player__frame" bind:this={frame} {style} />
{#if replayer}
<Controller
Expand Down
1 change: 1 addition & 0 deletions packages/rrweb-player/src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import _Player from './Player.svelte';

type PlayerProps = {
events: eventWithTime[];
playerClassName?: string;
};

class Player extends _Player {
Expand Down
5 changes: 5 additions & 0 deletions packages/rrweb-player/typings/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,11 @@ export type RRwebPlayerOptions = {
* @default `[]`
*/
events: eventWithTime[];
/**
* The classname which apply to the player
* @defaultValue `''`
*/
playerClassName?: string;
/**
* The width of the replayer
* @defaultValue `1024`
Expand Down
Loading