// Video Example
PlayButton.onclick = function() {
Video1.play();
}
Created page with "file:Video.jpg '''Description''' The Video control is used to play a video. The video has to be in a specific format, best explained in http://www.diveintohtml5.com/vide..." |
No edit summary |
||
(11 intermediate revisions by 3 users not shown) | |||
Line 1: | Line 1: | ||
[[ | [[File:Video.jpg]] | ||
== Description == | |||
The Video control is used to play a video. The video has to be in a specific format, best explained in http://www.diveintohtml5.com/video.html. Generally, H.264+AAC+MP4 will work. | The Video control is used to play a video. The video has to be in a specific format, best explained in http://www.diveintohtml5.com/video.html. Generally, H.264+AAC+MP4 will work. | ||
Line 7: | Line 6: | ||
To add video to your app, choose the Video icon in the Toolbar, then position it on the Design Screen. Use the Property Editor to set the properties you need. The video may not appear immediately: it needs time to load. | To add video to your app, choose the Video icon in the Toolbar, then position it on the Design Screen. Use the Property Editor to set the properties you need. The video may not appear immediately: it needs time to load. | ||
To play a video recorded on an Android device using the MediaCapture plugin, you need to include this in the ContentSecurityPolicy: | |||
<pre> | |||
img-src android-webview-video-poster:; | |||
</pre> | |||
Standard [[properties|properties]] are supported, plus: | == Properties == | ||
Standard [[properties and methods|properties]] are supported, plus: | |||
{| class = "wikitable" | {| class = "wikitable" | ||
|- | |- | ||
Line 23: | Line 27: | ||
|} | |} | ||
== Methods == | |||
{| class="wikitable" | {| class="wikitable" | ||
|- | |- | ||
Line 31: | Line 36: | ||
|} | |} | ||
== Example == | |||
< | <tabber> | ||
JavaScript= | |||
<syntaxhighlight lang="JavaScript"> | |||
// Video Example | |||
PlayButton.onclick = function() { | |||
Video1.play(); | |||
} | |||
</syntaxhighlight> | |||
|-| | |||
BASIC= | |||
<syntaxhighlight lang="vb.net"> | |||
Rem Video Example | |||
Function PlayButton_onclick() | Function PlayButton_onclick() | ||
Video1.play() | Video1.play() | ||
End Function | End Function | ||
</ | </syntaxhighlight> | ||
</tabber> | |||
== Output == | |||
<pre> | <pre> | ||
Line 46: | Line 63: | ||
</pre> | </pre> | ||
[[Category:Language Reference]] | |||
[[Category:Controls]] | |||
[[ | [[Category:General]] |
The Video control is used to play a video. The video has to be in a specific format, best explained in http://www.diveintohtml5.com/video.html. Generally, H.264+AAC+MP4 will work.
To add video to your app, choose the Video icon in the Toolbar, then position it on the Design Screen. Use the Property Editor to set the properties you need. The video may not appear immediately: it needs time to load.
To play a video recorded on an Android device using the MediaCapture plugin, you need to include this in the ContentSecurityPolicy:
img-src android-webview-video-poster:;
Standard properties are supported, plus:
autoplay | Video will start playing as soon as ready. |
controls | Controls will be displayed, such as a Play. |
loop | Video will start over again when finished. |
preload | Video should be loaded when the page loads. Ignored if autoplay is present. |
src | The name of the file. For example, http://www.nsbasic.com/videotest.mp4. It should be in the project folder or on a web site. |
pause() | Pause playing the video |
play() | Start playing the video |
// Video Example
PlayButton.onclick = function() {
Video1.play();
}
Rem Video Example
Function PlayButton_onclick()
Video1.play()
End Function
(video plays. Appearance will depend on the device. May take over the full screen.)