<commit_before>// A cross-browser javascript shim for html5 audio

//  Todo:
//
//  - camelCased method & variable names
//  - Add a test case for a single player with a playlist
//  - Opera cached SWF bug?
//  - MP3s are requested multiple times
//  - document.ready fails on error

(function(audioJS, audioJS_instance, container) {

  // ##The audioJS interface
  // This is the global object which provides an interface for creating new `audioJS` instances.
  // It also stores all of the construction helper methods and variables.
  container[audioJS] = {
    instance_count: 0,
    instances: {},
    // ### String storage
    // The css required by the default player. This is is injected into a `<style>` tag dynamically.
    default_css: '\
      .audiojs { font-family: monospace; position: relative; } \
      .audiojs .play_pause { clear: both; cursor: pointer; -webkit-text-selection: none; height: 20px; line-height: 20px; text-align: center; background: #eee; color: #999; border: 1px solid #eee; font-size: 8px; float: left; margin: 0px 0px 10px; overflow: hidden; } \
      .audiojs .play_pause p { width: 20px; margin: 0px; font-family: sans-serif; } \
      .audiojs .scrubber { float: left; width: 300px; height: 20px; position: relative; left: 1px; border: 1px solid #eee; padding-left: 5px; line-height: 20px; white-space: nowrap; overflow: hidden; } \
      .audiojs .progress { z-index: 1; position: absolute; top: 0px; left: 0px; bottom: 0px; width: 0px; background: #ccc; } \
      .audiojs .loaded { position: absolute; top: 0px; left: 0px; bottom: 0px; width: 0px; background: #eee; } \
      .audiojs .time { display: none; float: left; color: #999; padding: 3px 0px 0px 10px; } \
      .audiojs .time em { font-style: normal; color: #666; } \
      .audiojs .time strong { font-weight: normal; } \
      .audiojs .loading { display: none; position: absolute; top: 3px; left: 8px; }',

    // The markup for the swf. It is injected into the page if there is not support for the `<audio>` element. The `$keys` are used as a micro-templating language.  
    // `$1` The name of the flash movie  
    // `$2` The path to the swf  
    // `$3` Cache invalidation  
    flash_source: '\
      <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" id="$1" width="1" height="1" name="$1"> \
        <param name="movie" value="$2?player_instance='+audioJS+'.instances[\'$1\']&datetime=$3"> \
        <param name="allowscriptaccess" value="always"> \
        <embed name="$1" src="$2?player_instance='+audioJS+'.instances[\'$1\']&datetime=$3" width="1" height="1" allowscriptaccess="always"> \
      </object>',

    // ### The main settings object
    // This is where all the default settings are stored. Each of these variables and methods can be overwritten by the user-provided `options` object.
    settings: {
      autoplay: false,
      loop: false,
      swf_location: './audiojs.swf',
      use_flash: (function() {
        var a = document.createElement('audio');
        return !(a.canPlayType && a.canPlayType('audio/mpeg;').replace(/no/, ''));
      })(),
      // The default markup and classes for creating the player:
      create_player: {
        markup: '\
          <div class="play_pause"> \
            <p class="play">PLY</p> \
            <p class="pause">PSE</p> \
          </div> \<commit_msg>Prevent the object tag from breaking layouts<commit_after>// A cross-browser javascript shim for html5 audio

//  Todo:
//
//  - camelCased method & variable names
//  - Add a test case for a single player with a playlist
//  - Opera cached SWF bug?
//  - MP3s are requested multiple times
//  - document.ready fails on error

(function(audioJS, audioJS_instance, container) {

  // ##The audioJS interface
  // This is the global object which provides an interface for creating new `audioJS` instances.
  // It also stores all of the construction helper methods and variables.
  container[audioJS] = {
    instance_count: 0,
    instances: {},
    // ### String storage
    // The css required by the default player. This is is injected into a `<style>` tag dynamically.
    default_css: '\
      .audiojs { font-family: monospace; position: relative; } \
      .audiojs .play_pause { clear: both; cursor: pointer; -webkit-text-selection: none; height: 20px; line-height: 20px; text-align: center; background: #eee; color: #999; border: 1px solid #eee; font-size: 8px; float: left; margin: 0px 0px 10px; overflow: hidden; } \
      .audiojs .play_pause p { width: 20px; margin: 0px; font-family: sans-serif; } \
      .audiojs .scrubber { float: left; width: 300px; height: 20px; position: relative; left: 1px; border: 1px solid #eee; padding-left: 5px; line-height: 20px; white-space: nowrap; overflow: hidden; } \
      .audiojs .progress { z-index: 1; position: absolute; top: 0px; left: 0px; bottom: 0px; width: 0px; background: #ccc; } \
      .audiojs .loaded { position: absolute; top: 0px; left: 0px; bottom: 0px; width: 0px; background: #eee; } \
      .audiojs .time { display: none; float: left; color: #999; padding: 3px 0px 0px 10px; } \
      .audiojs .time em { font-style: normal; color: #666; } \
      .audiojs .time strong { font-weight: normal; } \
      .audiojs .loading { display: none; position: absolute; top: 3px; left: 8px; }',

    // The markup for the swf. It is injected into the page if there is not support for the `<audio>` element. The `$keys` are used as a micro-templating language.  
    // `$1` The name of the flash movie  
    // `$2` The path to the swf  
    // `$3` Cache invalidation  
    flash_source: '\
      <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" id="$1" width="1" height="1" name="$1" style="position: absolute; left: -1px;"> \
        <param name="movie" value="$2?player_instance='+audioJS+'.instances[\'$1\']&datetime=$3"> \
        <param name="allowscriptaccess" value="always"> \
        <embed name="$1" src="$2?player_instance='+audioJS+'.instances[\'$1\']&datetime=$3" width="1" height="1" allowscriptaccess="always"> \
      </object>',

    // ### The main settings object
    // This is where all the default settings are stored. Each of these variables and methods can be overwritten by the user-provided `options` object.
    settings: {
      autoplay: false,
      loop: false,
      swf_location: './audiojs.swf',
      use_flash: (function() {
        var a = document.createElement('audio');
        return !(a.canPlayType && a.canPlayType('audio/mpeg;').replace(/no/, ''));
      })(),
      // The default markup and classes for creating the player:
      create_player: {
        markup: '\
          <div class="play_pause"> \
            <p class="play">PLY</p> \
            <p class="pause">PSE</p> \
          </div> \
{'fraction_non_alphanumeric': 0.14422934830796513, 'fraction_numerical': 0.02615634697798138, 'mean_word_length': 2.962529274004684, 'pattern_counts': {'":': 0, '<': 29, '<?xml version=': 0, '>': 29, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6040557', 'n_tokens_mistral': 2260, 'n_tokens_neox': 2120, 'n_words': 710}