dyte-poll
A poll component.
Shows a poll where a user can vote.
<dyte-poll id="dyte-el"></dyte-poll>
<script>
const el = document.getElementById('dyte-el');
el.addEventListener('dyteVotePoll', (e) => {
console.log('Voted', e.detail);
});
el.poll = {
id: 'poll-id',
question: 'Have you started using dyte yet?',
options: [
{
text: 'Yes',
votes: [{ id: 'vaibhavs-user-id', name: 'Vaibhav' }],
count: 0,
},
{
text: 'Nope',
votes: [],
count: 0,
},
],
anonymous: false,
hideVotes: false,
createdBy: 'Vaibhav',
createdByUserId: 'vaibhavs-user-id',
voted: [],
};
</script>
Props
poll
required
Poll
Type
Poll
iconPack
permissions
Permissions Object
Type
({ readonly mediaRoomType: Readonly<MediaRoomType$1>; readonly stageEnabled: Readonly<boolean>; readonly acceptStageRequests: Readonly<boolean>; readonly stageAccess: Readonly<MediaProductionPermissionType>; readonly acceptWaitingRequests: Readonly<boolean>; readonly requestProduceVideo: Readonly<boolean>; readonly requestProduceAudio: Readonly<boolean>; readonly requestProduceScreenshare: Readonly<boolean>; readonly canAllowParticipantAudio: Readonly<boolean>; readonly canAllowParticipantScreensharing: Readonly<boolean>; readonly canAllowParticipantVideo: Readonly<boolean>; readonly canDisableParticipantAudio: Readonly<boolean>; readonly canDisableParticipantVideo: Readonly<boolean>; readonly kickParticipant: Readonly<boolean>; readonly pinParticipant: Readonly<boolean>; readonly canRecord: Readonly<boolean>; readonly waitingRoomType: Readonly<WaitingRoomTypes>; readonly waitingRoomBehaviour: Readonly<WaitingRoomTypes>; readonly plugins: Readonly<{ canClose: boolean; canStart: boolean; canEditConfig?: boolean; config: { [pluginId: string]: Partial<{ accessControl: PluginAccessControls; disabled: boolean; handlesViewOnly: boolean; }>; }; }>; readonly polls: Readonly<{ canCreate: boolean; canVote: boolean; canView: boolean; }>; readonly produceVideo: Readonly<MediaProductionPermissionType>; readonly requestProduce: Readonly<boolean>; readonly canProduceVideo: Readonly<MediaProductionPermissionType>; readonly produceScreenshare: Readonly<MediaProductionPermissionType>; readonly canProduceScreenshare: Readonly<MediaProductionPermissionType>; readonly produceAudio: Readonly<MediaProductionPermissionType>; readonly canProduceAudio: Readonly<MediaProductionPermissionType>; readonly chatPublic: Readonly<{ canSend: boolean; text: boolean; files: boolean; }>; readonly chatPrivate: Readonly<{ canSend: boolean; canReceive: boolean; text: boolean; files: boolean; }>; readonly chatChannel: Readonly<{ canCreate: "NONE" | "ALL" | "PRIVATE" | "PUBLIC"; canDelete: "NONE" | "ALL" | "PRIVATE" | "PUBLIC"; canUpdate: "NONE" | "ALL" | "PRIVATE" | "PUBLIC"; canReadAll: boolean; }>; readonly chatMessage: Readonly<{ canDelete: "NONE" | "SELF" | "ALL"; canEdit: "NONE" | "SELF" | "ALL"; deleteCutoffTimeSeconds: number; editCutoffTimeSeconds: number; }>; readonly connectedMeetings: Readonly<{ canAlterConnectedMeetings: boolean; canSwitchConnectedMeetings: boolean; canSwitchToParentMeeting: boolean; }>; readonly hiddenParticipant: Readonly<boolean>; readonly showParticipantList: Readonly<boolean>; readonly canChangeParticipantRole: Readonly<boolean>; readonly canChangeParticipantPermissions: Readonly<boolean>; readonly canChangeTheme: Readonly<boolean>; readonly canPresent: Readonly<boolean>; readonly acceptPresentRequests: Readonly<boolean>; readonly canEditDisplayName: Readonly<boolean>; readonly maxScreenShareCount: number; readonly isRecorder: Readonly<boolean>; readonly canSpotlight: Readonly<boolean>; readonly canLivestream: Readonly<boolean>; readonly transcriptionEnabled: Readonly<boolean>; readonly isV2: true; readonly emit: <E extends keyof PermissionEvents>(event: E, ...args: Parameters<PermissionEvents[E]>) => boolean; readonly on: <E extends keyof PermissionEvents>(event: E, callback: PermissionEvents[E]) => DytePermissionsPreset$1; readonly addListener: <E extends keyof PermissionEvents>(event: E, callback: PermissionEvents[E]) => DytePermissionsPreset$1; readonly off: <T extends keyof PermissionEvents>(event: T, callback: PermissionEvents[T]) => DytePermissionsPreset$1; readonly once: <T extends keyof PermissionEvents>(event: T, callback: PermissionEvents[T]) => DytePermissionsPreset$1; readonly prependListener: <T extends keyof PermissionEvents>(event: T, callback: PermissionEvents[T]) => DytePermissionsPreset$1; readonly prependOnceListener: <T extends keyof PermissionEvents>(event: T, callback: PermissionEvents[T]) => DytePermissionsPreset$1; readonly removeListener: <T extends keyof PermissionEvents>(event: T, callback: PermissionEvents[T]) => DytePermissionsPreset$1; readonly removeAllListeners: <T extends keyof PermissionEvents>(event?: T) => DytePermissionsPreset$1; readonly listeners: <T extends keyof PermissionEvents>(event: T) => Function[]; readonly listenerCount: <T extends keyof PermissionEvents>(event: T) => number; readonly setMaxListeners: (n: number) => DytePermissionsPreset$1; readonly getMaxListeners: () => number; readonly rawListeners: (eventName: string | symbol) => Function[]; readonly eventNames: () => (string | symbol)[]; }) | ({ readonly mediaRoomType: Readonly<MediaRoomType>; readonly viewType: string; readonly stageEnabled: Readonly<boolean>; readonly stageAccess: Readonly<CanProduceType>; readonly acceptWaitingRequests: Readonly<boolean>; readonly requestProduce: Readonly<boolean>; readonly requestProduceAudio: Readonly<boolean>; readonly requestProduceScreenshare: Readonly<boolean>; readonly canAllowParticipantAudio: Readonly<boolean>; readonly canAllowParticipantScreensharing: Readonly<boolean>; readonly canAllowParticipantVideo: Readonly<boolean>; readonly canDisableParticipantAudio: Readonly<boolean>; readonly canDisableParticipantVideo: Readonly<boolean>; readonly kickParticipant: Readonly<boolean>; readonly pinParticipant: Readonly<boolean>; readonly canRecord: Readonly<boolean>; readonly waitingRoomType: string; readonly waitingRoomBehaviour: Readonly<WaitingRoomType>; readonly plugins: Readonly<{ canClose: boolean; canStart: boolean; canEditAcl: boolean; config: { [key: string]: any; }; }>; readonly polls: Readonly<PollsPermission>; readonly produceVideo: Readonly<{ allow: CanProduceType; quality: string; frameRate: number; }>; readonly canProduceVideo: Readonly<CanProduceType>; readonly produceScreenshare: Readonly<{ allow: CanProduceType; quality: string; frameRate: number; }>; readonly canProduceScreenshare: Readonly<CanProduceType>; readonly produceAudio: Readonly<CanProduceType>; readonly canProduceAudio: Readonly<CanProduceType>; readonly chatPublic: Readonly<{ canSend: boolean; text: boolean; files: boolean; }>; readonly transcriptionEnabled: Readonly<boolean>; readonly chatPrivate: Readonly<{ canSend: boolean; text: boolean; files: boolean; canReceive?: boolean; }>; readonly chatChannel: Readonly<{ canCreate: "NONE" | "ALL" | "PRIVATE" | "PUBLIC"; canDelete: "NONE" | "ALL" | "PRIVATE" | "PUBLIC"; canUpdate: "NONE" | "ALL" | "PRIVATE" | "PUBLIC"; canReadAll: boolean; }>; readonly chatMessage: Readonly<{ canDelete: "NONE" | "SELF" | "ALL"; canEdit: "NONE" | "SELF" | "ALL"; deleteCutoffTimeSeconds: number; editCutoffTimeSeconds: number; }>; readonly connectedMeetings: { canAlterConnectedMeetings: boolean; canSwitchConnectedMeetings: boolean; canSwitchToParentMeeting: boolean; }; readonly reactions: Readonly<boolean>; readonly hiddenParticipant: Readonly<boolean>; readonly showParticipantList: Readonly<boolean>; readonly canChangeParticipantRole: Readonly<boolean>; readonly canChangeTheme: Readonly<boolean>; readonly canPresent: Readonly<boolean>; readonly acceptPresentRequests: Readonly<boolean>; readonly acceptStageRequests: Readonly<boolean>; readonly canEditDisplayName: Readonly<boolean>; readonly maxScreenShareCount: number; readonly isRecorder: Readonly<boolean>; readonly canLivestream: Readonly<boolean>; readonly canSpotlight: Readonly<boolean>; readonly isV2: false; readonly emit: <E extends keyof PermissionEvents>(event: E, ...args: Parameters<PermissionEvents[E]>) => boolean; readonly on: <E extends keyof PermissionEvents>(event: E, callback: PermissionEvents[E]) => DytePermissionsPresetV1$1; readonly addListener: <E extends keyof PermissionEvents>(event: E, callback: PermissionEvents[E]) => DytePermissionsPresetV1$1; readonly off: <T extends keyof PermissionEvents>(event: T, callback: PermissionEvents[T]) => DytePermissionsPresetV1$1; readonly once: <T extends keyof PermissionEvents>(event: T, callback: PermissionEvents[T]) => DytePermissionsPresetV1$1; readonly prependListener: <T extends keyof PermissionEvents>(event: T, callback: PermissionEvents[T]) => DytePermissionsPresetV1$1; readonly prependOnceListener: <T extends keyof PermissionEvents>(event: T, callback: PermissionEvents[T]) => DytePermissionsPresetV1$1; readonly removeListener: <T extends keyof PermissionEvents>(event: T, callback: PermissionEvents[T]) => DytePermissionsPresetV1$1; readonly removeAllListeners: <T extends keyof PermissionEvents>(event?: T) => DytePermissionsPresetV1$1; readonly listeners: <T extends keyof PermissionEvents>(event: T) => Function[]; readonly listenerCount: <T extends keyof PermissionEvents>(event: T) => number; readonly setMaxListeners: (n: number) => DytePermissionsPresetV1$1; readonly getMaxListeners: () => number; readonly rawListeners: (eventName: string | symbol) => Function[]; readonly eventNames: () => (string | symbol)[]; })
self
Self ID
Type
string