Module:Video/doc

From Downtime Wiki
Revision as of 14:18, 6 March 2025 by MC>Mykytius
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

This is the documentation page for Module:Video

This is the documentation page. It is transcluded into Module:Video. See Template:Documentation for more information.

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 a nil value.
  • VideoWidth: Optional. The width of the video instance, non-number will be ignored, defaults to 425.
  • VideoHeight: Optional. The height of the video instance, non-number will be ignored. If not set, it will be calculated by width 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