Skip to content
Alexandru Branza edited this page Jan 29, 2016 · 3 revisions

WebChimera Player comes with a QML API that offers advance use of the player and it's functionality. For the API to work, you will need to include Player QML API Header in your main.qml and not change the QML Component IDs (as many functions reference those components by id).


Table of Contents

Functions

All WebChimera Player QML API functions can be called with the wjs. prefix. Also see WebChimera Plugin QML API


UI Interaction


.setText( message ): Sets "message" as the text in the top right of the screen. (fades out after 3 seconds)

.togFullscreen(): Toggle Fullscreen

.togglePlaylist(): Open/Close Playlist Menu

.toggleSubtitles(): Open/Close Subtitle Menu

.toggleUI(): Show/Hide User Interface (top bar, toolbar, menus)

.showUI(): Show User Interface

.hideUI(): Hide User Interface

.toggleToolbar(): Show/Hide Toolbar


External File Handling


.playM3U( m3u-url ): Loads and starts playing the M3U playlist file from "m3u-url"

.playSubtitles( subtitle-url ): Loads and starts playing the subtitle file from "subtitle-url" (supports SUB and SRT)

.clearSubtitles(): Removes the currently loaded Exterior or Interior Subtitle.


Playback


.togPause(): Toggle Pause

.rateTo( direction ): Increases/Decreases playback speed. (direction can be "increase" or "decrease", default value is 1)


Video Navigation


.nextFrame( milliseconds ): Jump to [current-time] + [milliseconds]. (this will also pause playback)

.jumpTo( milliseconds ): Jump to [current-time] +/- [milliseconds]. (number can be positive or negative)


Video Resize


.changeZoom( zoom ): "zoom" can be 0.25, 0.5, 1, 2, 3, etc (default is 1)

.changeAspect( aspect-ratio , type ): "aspect-ratio" can be 1:1, 16:9, 2.21:1, etc, "type" can be "crop" or "ratio" (refers to aspect ratio)

.resetAspect(): Default back to normal video's size / aspect ratio.


Audio


.toggleMute(): Toggle Audio Mute

.setMute( bool ): Set Mute State. (can be true or false)

.volumeTo( int ): Set volume to [current-volume] +/- [int]. (number can be positive or negative)


Time


.getTime( milliseconds ): Returns human readable time from [milliseconds] (format "00:00:00")

.getLengthTime(): Returns human readable time from current video length (format "00:00:00")

.getLength(): Returns milliseconds of current video length