Skip to content
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
2 changes: 2 additions & 0 deletions src/components/FlowPlayer/FlowPlayer.internal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ const FlowPlayerInternal: FunctionComponent<FlowPlayerProps> = ({
speed,
dataPlayerId,
autoplay,
muted,
plugins = ALL_FLOWPLAYER_PLUGINS,
start,
end,
Expand Down Expand Up @@ -351,6 +352,7 @@ const FlowPlayerInternal: FunctionComponent<FlowPlayerProps> = ({

// CONFIGURATION
autoplay: autoplay ? flowplayerWithPlugins.autoplay.ON : flowplayerWithPlugins.autoplay.OFF,
muted,
multiplay: false,
ui:
ui ||
Expand Down
9 changes: 6 additions & 3 deletions src/components/FlowPlayer/FlowPlayer.mock.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
import { AvoContentTypeEnglish } from '@viaa/avo2-types';
import type { FlowPlayerProps, FlowplayerSourceList } from './FlowPlayer.types';

const MOCK_VIDEO_SRC =
'https://cdn.flowplayer.com/token:eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJzdWIiOiIwMTM3NDAyYi1jNDVjLTQ2ODUtODEwMy1hZTgyMDNlMmJlMjkiLCJuYmYiOjE3ODM1MDAzNjYsImlzcyI6Imh0dHBzOi8vd3d3LmZsb3dwbGF5ZXIuY29tIiwiZXhwIjoxNzgzNTg2NzY2LCJpYXQiOjE3ODM1MDAzNjZ9.GtS9ThnGVbtqgbkUc0-ECYQIEl_MIKKjkrvHRxa69pSIN2JAbGXcZPcbC1uFLAY02kdDYOq2HEzN0gtTyWjcQI3KFBGdiXNH5YppB0NoHcuAPciW73qMg1vNG8nMT8XkQxlBKg_NmPq_1DLPooMX9jBik4mF3Sd6eeEtqgSl0V8CZ9B3qGWxofjhD5wG6iteIJWmg_7cOOK3w3lUPMkIUyZp9exyJeLHgg7owYivmWu8j0DRohruoeiSe2em5Iy8dNAc3jv_HSWsrUsINexWZZ_tSkl6eoNFAcF-qOGnt8wQkonl8gELPnqAjGQUQra4urFZVNtukE0esyIBFsH__w6csiyMeWUGBQhBTHW7yK5Cby_Ph7s-vi_8AliYERX1zkhrkI3RpnJJ4YCSs2PRZj8mKE8u8z3wUKc5ECbxQfL1KgW07Ex380UvTwG_1VPZ7NJtX8K3gOMw6RYe2TAQHqbHm9Wlv5FtJIsk24t2IXZiJ8uvm28yHfiniuDVJ6tN6D6iy9xyhRUXxOEmR8o2fAnU950bqM5r9V0QqTP5OLzE2DQOZzp9YjUWwcTTbU0tFPQTzrOorbTCj0kPBWkBCkt5Yum3dPUs9tzBt_fbAu3EoojynF656DHga-l1nNiVDGj_jmVWC8Mz5bE4sTr2meziv1qH1rLgtSNTKtLLjY4/bacec074-242b-499f-9ca8-38e382b6e179/v-0137402b-c45c-4685-8103-ae8203e2be29_original.mp4';

const MOCK_FLOW_PLAYER_PROPS: FlowPlayerProps = {
src: 'http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/ElephantsDream.mp4',
src: MOCK_VIDEO_SRC,
title: 'Title',
autoplay: false,
type: AvoContentTypeEnglish.VIDEO,
Expand Down Expand Up @@ -43,7 +46,7 @@ export const MOCK_PLAYLIST_SOURCE: FlowplayerSourceList = {
cuepoints: [{ startTime: 15, endTime: 17 }],
},
{
src: 'http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/ElephantsDream.mp4',
src: MOCK_VIDEO_SRC,
title: 'Elephant dream',
category: AvoContentTypeEnglish.VIDEO,
provider: 'VRT',
Expand Down Expand Up @@ -75,7 +78,7 @@ export const MOCK_PLAYLIST_SOURCE: FlowplayerSourceList = {
cuepoints: [{ startTime: 5, endTime: 25 }],
},
{
src: 'http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/ElephantsDream.mp4',
src: MOCK_VIDEO_SRC,
title: 'Elephant dream 2',
category: AvoContentTypeEnglish.VIDEO,
provider: 'VRT',
Expand Down
9 changes: 9 additions & 0 deletions src/components/FlowPlayer/FlowPlayer.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,15 @@ export const AudioWithFallbackPeak: Story = {
render: Template,
};

export const MutedAutoplay: Story = {
args: {
...MOCK_FLOW_PLAYER_PROPS_FULL,
autoplay: true,
muted: true,
},
render: Template,
};

export const HlsSourceUrl: Story = {
args: {
...MOCK_FLOW_PLAYER_PROPS_FULL,
Expand Down
1 change: 1 addition & 0 deletions src/components/FlowPlayer/FlowPlayer.types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@ export interface FlowPlayerProps extends DefaultComponentProps {
token?: string;
dataPlayerId?: string;
autoplay?: boolean;
muted?: boolean;
pause?: boolean;
fullscreen?: boolean;
onPlay?: (src: string) => void;
Expand Down