video_NAFC_page | R Documentation |
Creates an n-alternative forced choice page with a video prompt.
video_NAFC_page(
label,
prompt,
choices,
url,
labels = NULL,
type = tools::file_ext(url),
save_answer = TRUE,
on_complete = NULL,
video_width = "100%",
arrange_choices_vertically = length(choices) > 2L,
wait = TRUE,
loop = FALSE,
admin_ui = NULL,
btn_play_prompt = if (!show_controls) "Click here to play",
show_controls = FALSE,
allow_download = FALSE
)
label |
Label for the current page (character scalar). |
prompt |
Prompt to be displayed above the response choices.
Can be either a character scalar (e.g. "What is 2 + 2?")
or an object of class "shiny.tag", e.g. |
choices |
Character vector of choices for the participant. If unnamed, then these values will be used both for button IDs and for button labels. If named, then values will be used for button IDs and names will be used for button labels. |
url |
URL to the video. Can be an absolute URL (e.g. "http://mysite.com/video.mp4") or a URL relative to the /www directory (e.g. "video.mp4"). |
labels |
Optional vector of labels for the NAFC choices.
If not |
type |
Video type (e.g. 'mp4'). Defaults to the provided file extension. |
save_answer |
Whether or not to save the answer. |
on_complete |
Optional function to execute on leaving the page
(after successful validation).
The argument list should include |
video_width |
Video width, as passed to HTML (e.g. '50px'). |
arrange_choices_vertically |
Whether to arrange the response buttons vertically (the default) as opposed to horizontally. |
wait |
Whether to wait for the video to finish before displaying the response buttons. |
loop |
Whether the video should loop. |
admin_ui |
Optional UI component for the admin panel. |
btn_play_prompt |
Text to display as a prompt for starting the audio. Ordinarily the participant will not see this, but it might appear if the internet connection is poor, or if the participant refreshes the page. Only used if show_controls is FALSE. |
show_controls |
Whether or not to show audio controls to the participant, so that they can control audio playback. |
allow_download |
Whether the participant is given a button to download the audio file; only relevant if show_controls is TRUE. |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.