Module:Video/doc
This is the documentation page for Module:Video
This module implements {{#if:{{#switch: yes
| y | yes | t | true | on | 1 = yes | n | no | f | false | off | 0 | = | = | #default = yes
}}|}}{{{{#if: |subst: }}[[{{#if: {{#pos: YouTube | : }} || Template: }}YouTube|{{ #ifeq: | Template | YouTube | YouTube }}]]{{ #if: | | }}{{ #if: | | }}{{ #if: | | }}{{ #if: | | }}{{ #if: | | }}{{ #if: | | }}{{ #if: | | }}{{ #if: | | }}}}{{#if:{{#switch: yes
| y | yes | t | true | on | 1 = yes
| n | no | f | false | off | 0 | =
| =
| #default = yes
}}|
}}{{#if: {{#pos: YouTube | File: }}{{#pos: YouTube | Category: }} | }} and {{#if:{{#switch: yes
| y | yes | t | true | on | 1 = yes | n | no | f | false | off | 0 | = | = | #default = yes
}}|}}{{{{#if: |subst: }}[[{{#if: {{#pos: Vimeo | : }} || Template: }}Vimeo|{{ #ifeq: | Template | Vimeo | Vimeo }}]]{{ #if: | | }}{{ #if: | | }}{{ #if: | | }}{{ #if: | | }}{{ #if: | | }}{{ #if: | | }}{{ #if: | | }}{{ #if: | | }}}}{{#if:{{#switch: yes
| y | yes | t | true | on | 1 = yes
| n | no | f | false | off | 0 | =
| =
| #default = yes
}}|
}}{{#if: {{#pos: Vimeo | File: }}{{#pos: Vimeo | Category: }} | }}, and allows invocations from other modules.
See their documentations to learn how to use through a template.
Functions
Other modules can invoke this module, to implement more advanced features.
Exported functions listed below.
genVideo
This function generates a pure video instance.
Syntax: genVideo( VideoServiceProvider, VideoID, VideoWidth, VideoHeight, VideoAlign, VideoCaption, URLArgs )
VideoServiceProvider
: Optional. The video service provider. If not set,youtube
will used.VideoID
: A video ID. If not set, this function will directly return anil
value.VideoWidth
: Optional. The width of the video instance, non-number will be ignored, defaults to425
.VideoHeight
: Optional. The height of the video instance, non-number will be ignored. If not set, it will be calculated bywidth
automatically to keep aspect ratio to 16:9.VideoAlign
: Optional. The type of video alignment.VideoCaption
: Optional. The small text below the video.URLArgs
: Optional. The arguments which should append to the URL of the video.
main
This function is used for template invocation, and without any extra parameters accepted, and should not be invocated by other modules.
Dependencies
pt:Módulo:Vídeo/doc ru:Модуль:Видеоролик/док uk:Модуль:Відеоролик/док zh:Module:Video/doc