Video

From MegaZine3
(Redirected from Vid)
Jump to navigation Jump to search

The vid element is used to load videos (FLV, F4V). As of Update 3 for FlashPlayer 9 it is also possible to load h.264 encoded videos if using one of the following container formats: MP4, M4A, MOV, MPV4, 3GP, and 3G2. More information at Adobe's webpage.

Attributes

{{#switch:left | left =

{{#switch:{{#if: | {{{smallimage}}} | }} | none =

| #default =

}} {{#if:{{#if: | {{{smallimageright}}} | }} | {{#ifeq:{{#if: | {{{smallimageright}}} | }}|none | | }} }}

| #default =

{{#switch: | none =

| #default =

}}

{{#if: | {{#ifeq:|none

 | 
| }} }}

}}

== aa =={{#if: Boolean |

  • Type: Boolean}}{{#if: |
  • Valid values: {{{valid}}}}}{{#if: false |
  • Default: false}}{{#if: |
  • Overrides: {{{overrides}}}}}{{#if: |
  • Aliases: {{{alias}}}}}{{#if: |
  • Version: {{{version}}}}}

Determines whether to use anti aliasing (smoothing) for the video. This can result in noticeably improved quality of the video while dragging a page or zooming. Can have a high impact on performance, though.{{#if: img@aa |

== autoplay =={{#if: Boolean |

  • Type: Boolean}}{{#if: |
  • Valid values: {{{valid}}}}}{{#if: true |
  • Default: true}}{{#if: |
  • Overrides: {{{overrides}}}}}{{#if: |
  • Aliases: {{{alias}}}}}{{#if: |
  • Version: {{{version}}}}}

Determines whether to automatically start video playback as soon as a context where it may play is entered (i.e. when it's on a visible page if nopause is false, and on the main page if onlywhenactive is true).
Attention: If the attribute restart is set to 'true', this overrules autoplay='false' and will start the video immediately.{{#if: |

  • See also: {{{see}}}}}

== delay =={{#if: Integer |

  • Type: Integer}}{{#if: |
  • Valid values: {{{valid}}}}}{{#if: 0 |
  • Default: 0}}{{#if: |
  • Overrides: {{{overrides}}}}}{{#if: |
  • Aliases: {{{alias}}}}}{{#if: |
  • Version: {{{version}}}}}

Time in milliseconds before the sound starts fading in and video playback is started. This does not affect fadeout, which will still begin immediately if the containing page becomes invisible.{{#if: |

  • See also: {{{see}}}}}

== fade =={{#if: Integer |

  • Type: Integer}}{{#if: |
  • Valid values: {{{valid}}}}}{{#if: 2000 |
  • Default: 2000}}{{#if: |
  • Overrides: {{{overrides}}}}}{{#if: |
  • Aliases: {{{alias}}}}}{{#if: |
  • Version: {{{version}}}}}

Time in milliseconds over which to fade in and out the sound of the video when the containing page becomes visible or hidden, respectively.{{#if: |

  • See also: {{{see}}}}}

== gui =={{#if: String |

  • Type: String}}{{#if: |
  • Valid values: {{{valid}}}}}{{#if: |
  • Default: {{{default}}}}}{{#if: |
  • Overrides: {{{overrides}}}}}{{#if: |
  • Aliases: {{{alias}}}}}{{#if: |
  • Version: {{{version}}}}}

Absolute or relative path to the gui file to use (playback controls). Relative paths are always relative to the megazine.swf file. A default gui is delivered with the other elements, called vidgui.swf. To use it, add gui="elements/vidgui.swf" in the vid tag.{{#if: |

  • See also: {{{see}}}}}

== guicolor =={{#if: Integer |

  • Type: Integer}}{{#if: |
  • Valid values: {{{valid}}}}}{{#if: 0x7F333333 |
  • Default: 0x7F333333}}{{#if: |
  • Overrides: {{{overrides}}}}}{{#if: |
  • Aliases: {{{alias}}}}}{{#if: |
  • Version: {{{version}}}}}

Color overlay of the playback controls as an RGB or ARGB value. If no alpha value is given alpha will be 0.75.{{#if: |

  • See also: {{{see}}}}}

== height =={{#if: Number |

  • Type: Number}}{{#if: |
  • Valid values: {{{valid}}}}}{{#if: height of loaded object |
  • Default: height of loaded object}}{{#if: |
  • Overrides: {{{overrides}}}}}{{#if: |
  • Aliases: {{{alias}}}}}{{#if: |
  • Version: {{{version}}}}}

The height of the element. If not given, uses the actual size of the loaded element. If the given value is smaller than 1 the size is interpreted to be relative to the actual size, i.e. the loaded element is scaled by that factor.{{#if: |

  • See also: {{{see}}}}}

== loop =={{#if: Boolean |

  • Type: Boolean}}{{#if: |
  • Valid values: {{{valid}}}}}{{#if: true |
  • Default: true}}{{#if: |
  • Overrides: {{{overrides}}}}}{{#if: |
  • Aliases: {{{alias}}}}}{{#if: |
  • Version: {{{version}}}}}

Determines whether the video runs in an infinite loop or is played only once, and must then be started again manually (e.g. via playback controls defined in gui).{{#if: |

  • See also: {{{see}}}}}

== nopause =={{#if: Boolean |

  • Type: Boolean}}{{#if: |
  • Valid values: {{{valid}}}}}{{#if: false |
  • Default: false}}{{#if: |
  • Overrides: {{{overrides}}}}}{{#if: |
  • Aliases: {{{alias}}}}}{{#if: |
  • Version: {{{version}}}}}

Normally videos are paused when the containing page is not visible, to save performance. This setting can be used to override this behavior. When using many videos, though, this can have a heavy impact on performance!{{#if: |

  • See also: {{{see}}}}}

== onlywhenactive =={{#if: Boolean |

  • Type: Boolean}}{{#if: |
  • Valid values: {{{valid}}}}}{{#if: false |
  • Default: false}}{{#if: |
  • Overrides: {{{overrides}}}}}{{#if: |
  • Aliases: {{{alias}}}}}{{#if: |
  • Version: {{{version}}}}}

When set to true, playback may only commence once the containing page is the main / current page. Normally playback can begin once the page is visible, i.e. even if it is just visible because the user lifts the corner of the page hiding the containing page.{{#if: |

  • See also: {{{see}}}}}

== preview =={{#if: String |

  • Type: String}}{{#if: |
  • Valid values: {{{valid}}}}}{{#if: |
  • Default: {{{default}}}}}{{#if: |
  • Overrides: {{{overrides}}}}}{{#if: |
  • Aliases: {{{alias}}}}}{{#if: |
  • Version: {{{version}}}}}

Path to an image to display which has to be clicked by the user before loading the actual video. This way the initial page loading will be sped up, and less bandwidth will be wasted if the user is not interested in the video.

The image will be loaded into an ASUL element defined in the megazine.asul file (id vidpreview). Per default this will overlay the image with a play button, to hint the user has to click first to play the video.

  • Important: when using the preview attribute, you must set the vid@width and vid@height attributes. This is necessary because otherwise the size of the video is unknown, and therefore no size can be set for the preview image.{{#if: |
  • See also: {{{see}}}}}

== restart =={{#if: Boolean |

  • Type: Boolean}}{{#if: |
  • Valid values: {{{valid}}}}}{{#if: false |
  • Default: false}}{{#if: |
  • Overrides: {{{overrides}}}}}{{#if: |
  • Aliases: {{{alias}}}}}{{#if: |
  • Version: {{{version}}}}}

When set to true, instead of continuing the playback when the user returns to the containing page, the video is restarted, i.e. playback begins anew at the beginning.
The video also is started immediately when it becomes active/visible; independent on the settings of the autplay attribute.{{#if: |

  • See also: {{{see}}}}}

== stoptopreview =={{#if: String |

  • Type: String}}{{#if: |
  • Valid values: {{{valid}}}}}{{#if: |
  • Default: {{{default}}}}}{{#if: |
  • Overrides: {{{overrides}}}}}{{#if: |
  • Aliases: {{{alias}}}}}{{#if: 2.1.2 |
  • Version: 2.1.2}}

To allow reverting to preview image when stopping a video.{{#if: |

  • See also: {{{see}}}}}

== src =={{#if: String |

  • Type: String}}{{#if: |
  • Valid values: {{{valid}}}}}{{#if: |
  • Default: {{{default}}}}}{{#if: |
  • Overrides: {{{overrides}}}}}{{#if: |
  • Aliases: {{{alias}}}}}{{#if: |
  • Version: {{{version}}}}}

Absolute or relative path to the video file to load. Relative paths are (normally) relative to the megazine.swf file.{{#if: |

  • See also: {{{see}}}}}

== width =={{#if: Number |

  • Type: Number}}{{#if: |
  • Valid values: {{{valid}}}}}{{#if: width of loaded object |
  • Default: width of loaded object}}{{#if: |
  • Overrides: {{{overrides}}}}}{{#if: |
  • Aliases: {{{alias}}}}}{{#if: |
  • Version: {{{version}}}}}

The width of the element. If not given, uses the actual size of the loaded element. If the given value is smaller than 1 the size is interpreted to be relative to the actual size, i.e. the loaded element is scaled by that factor.{{#if: |

  • See also: {{{see}}}}}

Examples

<book>
    <chapter>
        <page>
            <vid src="data/video.f4v" position="middle center"
                 onlywhenactive="true" gui="elements/vidgui.swf"
                 preview="data/video_preview.jpg"/>
        </page>
        <!-- ... -->
    </chapter>
</book>
MegaZine3 Core-related articles
Book elements Book · Chapter · Page · Spreadpage
Page elements Area · GIF · Image · Navigation · Sound · Text · Video