AudioCard component displays participant information, audio waveform, and media control buttons.

This component provides an animated waveform for audio activity, control buttons to toggle audio and video, and options for customization of appearance, layout, and media controls. It leverages WebSocket for real-time updates and accommodates custom styling and control component integrations.

import React from 'react';
import { AudioCard } from 'mediasfu-reactnative-expo';
import { io } from 'socket.io-client';

function App() {
const socket = io('http://localhost:3000');

return (
<AudioCard
name="John Doe"
barColor="blue"
textColor="white"
imageSource="https://example.com/image.jpg"
showControls={true}
showInfo={true}
participant={{ name: "John Doe", muted: false, videoOn: true }}
parameters={{
audioDecibels: [{ name: "John Doe", averageLoudness: 128 }],
participants: [{ name: "John Doe" }],
socket,
coHostResponsibility: [],
roomName: "Room 1",
coHost: "Admin",
islevel: "1",
member: "12345",
eventType: "meeting",
showAlert: ({ message, type }) => console.log(message, type),
getUpdatedAllParams: () => ({}),
}}
/>
);
}

export default App;

Properties

propTypes?: WeakValidationMap<AudioCardOptions>

Used to declare the types of the props accepted by the component. These types will be checked during rendering and in development only.

We recommend using TypeScript instead of checking prop types at runtime.

contextTypes?: ValidationMap<any>

Lets you specify which legacy context is consumed by this component.

defaultProps?: Partial<AudioCardOptions>

Used to define default values for the props accepted by the component.

type Props = { name?: string }

const MyComponent: FC<Props> = (props) => {
return <div>{props.name}</div>
}

MyComponent.defaultProps = {
name: 'John Doe'
}
displayName?: string

Used in debugging messages. You might want to set it explicitly if you want to display a different name for debugging purposes.


const MyComponent: FC = () => {
return <div>Hello!</div>
}

MyComponent.displayName = 'MyAwesomeComponent'