Player options

Player contains a large number of options for configuring the playback and the plugins behavior.

These are the bacic options for configuring the player :

Options Type Description
src String URL to a video or audio file
poster String URL to a poster image to display before playback starts
autoplay Boolean Automatically start playing the video on page load
defaultVolume Number 75 by default.This value is overloaded by the volume set by the user which is kept in a cookie
plugins Object Plugin configuration
framerate Number video framerate Default value: 25
controlBarClassName String Control bar class name Default value: "fr.ina.amalia.player.plugins.CustomControlBarPlugin"
controlBar Object Attribute to set default control bar.
tcOffset Number time code offset
thumbRootDirectory String
crossorigin String CORS settings attribute
shortcuts Object To configure shortcuts.
debug Boolean To enable debug mode

As already mentioned in the quickstart section the src parameter is the only one that is mandatory. One might also generally consider setting the autoplay to false.

If you need to change the appearence of the player, have a look at the CSS styles. Depending on the part you want to change, it is a good starting point. You may also have to modify the plugin directly.

Example


$("#container").mediaPlayer({

    autoplay: true,

    crossorigin: 'Anonymous',

    src: "samples-data/examples/vid/amalia01.mp4",

    debug:true,

    shortcuts: {

        enabled: true,

        debug: false,

        listOfShortcuts: [

            {'s': 'f3', 'c': 'moveNextFrame'},

            {'s': 'f4', 'c': 'movePrevFrame'}

        ]

    },

    controlBar:

            {

                sticky: true,

                autohide: false,

                enableProgressBar: false,

                height: 75,

                widgets:

                        {

                            left: {

                                'timelabelWidget': 'fr.ina.amalia.player.plugins.controlBar.widgets.TimeLabel',

                                'playWidget': 'fr.ina.amalia.player.plugins.controlBar.widgets.PlayButton',

                                'pauseWidget': 'fr.ina.amalia.player.plugins.controlBar.widgets.PauseButton'

                            },

                            mid: {

                                'JogShuttle': 'fr.ina.amalia.player.plugins.controlBar.widgets.JogShuttleButton'

                            },

                            right: {

                                'volume': 'fr.ina.amalia.player.plugins.controlBar.widgets.ChannelVolumeControlBar',

                                'full': 'fr.ina.amalia.player.plugins.controlBar.widgets.FullscreenButton'

                            },

                            settings: {

                                timelabelWidget: {

                                    timeFormat: 's',

                                    framerate: 20

                                },

                                sample: {

                                    style: 'fa fa-eye fa-2x',

                                    callback: 'myCallback'

                                },

                                secNext: {

                                    style: 'ajs-icon ajs-icon-control-forward',

                                    callback: 'myCallbackControl',

                                    action: 'next'

                                },

                                volume: {

                                    channelMerger: false

                                }

                            }

                        }

            },

    plugins: {...}

});

                

Documentation