Skip to content

module_multimedia

Wesley de Groot edited this page Oct 28, 2015 · 17 revisions
            	     _    _____ 
        	        | |  / ____|
    	            | |  | (___  
	            _   | |  \___  \ 
 ______    _   | |__| |  ____) |
|______|  (_)   \____/  |______/ 

Module: Multimedia

Supports:

Audio:
  • mp3 (audio/mpeg)
  • ogg (audio/ogg)
  • wav (audio/wav)

Best supported in browsers mp3

Video
  • mp4 (video/mp4)
  • ogg (video/ogg)
  • webm (video/webm)

Best supported in browsers mp4 removed ogg support, that is better for file reorganization

Features

  • Auto file reorganization (NO .OGG)
  • Built in ad system
  • Easy configuration/running
  • Fast
  • Customizable (via wrapper)

##### Standard how to use (with before, and after ads)
<script type='text/javascript'>
  _().require('_multimedia', function() { 
    _('.myWrapper').multimedia({
      before: 'audio/before.mp3',
      file:   'audio/main.mp3',
      after:  'audio/after.mp3'
    });
  });
</script>

##### multifiles (with before, and after ads)
<script type='text/javascript'>
  _().require('_multimedia', function() { 
    _('.myWrapper').multimedia({
      before: 'audio/before.mp3',
      file:   ['audio/file1.mp3','audio/file2.mp3','audio/file3.mp3'],
      after:  'audio/after.mp3'
    });
  });
</script>

##### **No** ads:
<script type='text/javascript'>
  _().require('_multimedia', function() { 
    _('.myWrapper').multimedia({
      file:   'audio/main.mp3',
    });
  });
</script>

##### ** Custom config (video) **
<script type='text/javascript'>
  _().require('_multimedia', function() { 
    _('.myWrapper').multimedia({
      file:   'audio/main.mp4',
      options: {
       controls: true,    // controls (true=player visible)
       type:     'video', // the player knows the rest (always use type if using .ogg file!)
                          // with video the player is always visible 
      }
    });
  });
</script>

##### ** custom config, player visible, audio **
<script type='text/javascript'>
  _().require('_multimedia', function() { 
    _('.myWrapper').multimedia({
      file:   'audio/main.mp3',
      options: {
       autoplay: false // start manually.
      }
    });
  });
</script>

##### Start (if autostart = off)
_().multimedia_start();

##### Pause
_().multimedia_pause();

##### Stop
_().multimedia_stop();

##### Skip
_().multimedia_skip();

*Not yet supported:* Ads random (for playlists), sorry.


Nerd Talk

Default options:

options = {
           autoplay: true,    // Automatic start playing?
           controls: false,   // Controls visible?
           visible:  false,   // Screen visible? [DEPRECATED]
           default:  true,    // Is it the default config? (unsettable)
           type:     'ERROR', // Media-Type. (Default: ERROR)
          };
Clone this wiki locally