PowerApps 中的音频和视频控件Audio and Video controls in PowerApps

一个控件,用于播放 YouTube 上的音频文件、视频文件或视频。A control that plays an audio file, a video file, or a video on YouTube.

说明Description

“音频”控件播放文件中的声音剪辑、“麦克风”控件中的录制内容或视频文件中的音轨。An Audio control plays a sound clip from a file, a recording from a Microphone control, or the audio track from a video file. “视频”控件播放文件或 YouTube(如果指定 URL)中的视频剪辑。A Video control plays a video clip from a file or from YouTube if you specify a URL.

关键属性Key properties

Loop - 音频或视频剪辑是否在播放完后自动重新开始。Loop – Whether an audio or video clip automatically starts over as soon as it finishes playing.

Media - 音频或视频控件播放的剪辑的标识符。Media – An identifier for the clip that an audio or video control plays.

ShowControls - 音频或视频播放器是否显示播放按钮和音量滑块等内容,以及笔控件是否显示绘图、擦除和清除等图标。ShowControls – Whether an audio or video player shows, for example, a play button and a volume slider, and a pen control shows, for example, icons for drawing, erasing, and clearing.

其他属性Additional properties

AutoPause - 用户导航到另一屏幕时音频或视频剪辑是否自动暂停。AutoPause – Whether an audio or video clip automatically pauses if the user navigates to a different screen.

AutoStart - 用户导航到包含音频或视频控件的屏幕时,该控件是否自动开始播放剪辑。AutoStart – Whether an audio or video control automatically starts to play a clip when the user navigates to the screen that contains that control.

BorderColor – 控件边框的颜色。BorderColor – The color of a control's border.

BorderStyle – 控件边框是实线虚线点线还是BorderStyle – Whether a control's border is Solid, Dashed, Dotted, or None.

BorderThickness – 控件边框的粗细。BorderThickness – The thickness of a control's border.

DisplayMode – 此控件是允许用户输入 (Edit)、仅显示数据 (View),还是已禁用 (Disabled)。DisplayMode – Whether the control allows user input (Edit), only displays data (View), or is disabled (Disabled).

Fill – 控件的背景颜色。Fill – The background color of a control.

Height – 控件上边缘和下边缘之间的距离。Height – The distance between a control's top and bottom edges.

Image - 图像、音频或麦克风控件中显示的图像名称。Image – The name of the image that appears in an image, audio, or microphone control.

ImagePosition - 屏幕或控件大小与图像大小不同时,其中图像的位置(“填充”、“适应”、“拉伸”、“平铺”或“居中”)。ImagePosition – The position (Fill, Fit, Stretch, Tile, or Center) of an image in a screen or a control if it isn't the same size as the image.

OnEnd - 音频或视频剪辑播放完成后应用如何响应。OnEnd – How an app responds when an audio or video clip finishes playing.

OnPause - 用户暂停音频或视频控件播放的剪辑时应用如何响应。OnPause – How an app responds when the user pauses the clip that an audio or video control is playing.

OnStart - 用户使用麦克风控件开始录制时应用如何响应。OnStart – How the app responds when the user starts to record with a microphone control.

Paused - 如果媒体播放控件当前已暂停,则为 True;否则为 falsePausedTrue if a media playback control is currently paused, false otherwise.

Reset - 控件是否还原为其默认值。Reset – Whether a control reverts to its default value.

Start - 是否播放音频或视频剪辑。Start – Whether an audio or video clip plays.

StartTime - 音频或视频剪辑开始播放之后的时间。StartTime – The time after the start of an audio or video clip when the clip starts to play.

Time - 媒体控件的当前位置。Time – A media control's current position.

Tooltip - 用户将鼠标悬停在控件上时显示的解释性文本。Tooltip – Explanatory text that appears when the user hovers over a control.

Visible – 控件显示还是隐藏。Visible – Whether a control appears or is hidden.

Width – 控件左边缘和右边缘之间的距离。Width – The distance between a control's left and right edges.

X - 控件左边缘与其父容器(如果没有父容器,则为屏幕)左边缘之间的距离。X – The distance between the left edge of a control and the left edge of its parent container (screen if no parent container).

Y - 控件上边缘与其父容器(如果没有父容器,则为屏幕)上边缘之间的距离。Y – The distance between the top edge of a control and the top edge of the parent container (screen if no parent container).

First( TableName )First( TableName )

示例Examples

播放音频或视频文件Play an audio or video file

  1. 在“文件”菜单上,依次单击或点击“媒体”、“视频”或“音频”、“浏览”。On the File menu, click or tap Media, click or tap Videos or Audio, and then click or tap Browse.
  2. 浏览到想要使用的文件,单击或点击它,然后单击或点击“打开”。Browse to the file you want to use, click or tap it, and then click or tap Open.
  3. 按 Esc 返回默认工作区,添加“音频”或“视频”控件,并将其 Media 属性设置为已添加的文件。Press Esc to return to the default workspace, add an Audio or Video control, and set its Media property to the file that you added.

    不知道如何添加和配置控件Don't know how to add and configure a control?

  4. 按 F5,然后通过单击或点击所添加的控件的播放按钮来播放剪辑。Press F5, and then play the clip by clicking or tapping the play button of the control that you added.

    提示:将鼠标悬停在“视频”控件上时便会显示此控件的播放按钮。Tip: The play button of the Video control appears when you hover over the control.

  5. 按 Esc 返回默认工作区。Press Esc to return to the default workspace.

播放 YouTube 视频Play a YouTube video

  1. 添加“视频”控件,并将其 Media 属性设置为 YouTube 视频的 URL(括在双引号内)。Add a Video control, and set its Media property to the URL, enclosed in double quotation marks, of a YouTube video.
  2. 按 F5,然后通过单击或点击“视频”控件的播放按钮来播放剪辑。Press F5, and then play the clip by clicking or tapping the play button of the Video control.
  3. 按 Esc 返回默认工作区。Press Esc to return to the default workspace.