text: /*! @name videojs-per-source-behaviors @version 2.1.0 @license Apache-2.0 */
  (function (QUnit,sinon,videojs) {
  	'use strict';
  
  	QUnit = QUnit && QUnit.hasOwnProperty('default') ? QUnit['default'] : QUnit;
  	sinon = sinon && sinon.hasOwnProperty('default') ? sinon['default'] : sinon;
  	videojs = videojs && videojs.hasOwnProperty('default') ? videojs['default'] : videojs;
  
  	var commonjsGlobal = typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
  
  	var minDoc = {};
  
  	var topLevel = typeof commonjsGlobal !== 'undefined' ? commonjsGlobal :
  	    typeof window !== 'undefined' ? window : {};
  
  
  	var doccy;
  
  	if (typeof document !== 'undefined') {
  	    doccy = document;
  	} else {
  	    doccy = topLevel['__GLOBAL_DOCUMENT_CACHE@4'];
  
  	    if (!doccy) {
  	        doccy = topLevel['__GLOBAL_DOCUMENT_CACHE@4'] = minDoc;
  	    }
  	}
  
  	var document_1 = doccy;
  
  	var version = "2.1.0";
  
  	var cov_1ynxojh1tt = function () {
  	  var path = '/Users/poneill/dev/videojs-per-source-behaviors/src/plugin.js',
  	      hash = '183bbee53d787ca6a19849a7ef29e68cec04888e',
  	      Function = function () {}.constructor,
  	      global = new Function('return this')(),
  	      gcv = '__coverage__',
  	      coverageData = {
  	    path: '/Users/poneill/dev/videojs-per-source-behaviors/src/plugin.js',
  	    statementMap: {
  	      '0': {
  	        start: {
  	          line: 4,
  	          column: 14
  	        },
  	        end: {
  	          line: 4,
  	          column: 38
  	        }
  	      },
  	      '1': {
  	        start: {
  	          line: 7,
  	          column: 23
  	        },
  	        end: {
  	          line: 7,
  	          column: 63
  	        }
  	      },
  	      '2': {
  	        start: {
  	          line: 17,
  	          column: 29
  	        },
  	        end: {
  	          line: 22,
  	          column: 1
  	        }
  	      },
  	      '3': {
  	        start: {
  	          line: 30,
  	          column: 24
  	        },
  	        end: {
  	          line: 33,
  	          column: 1
  	        }
  	      },
  	      '4': {
  	        start: {
  	          line: 41,
  	          column: 18
  	        },
  	        end: {
  	          line: 46,
  	          column: 1
  	        }
  	      },
  	      '5': {
  	        start: {
  	          line: 57,
  	          column: 18
  	        },
  	        end: {
  	          line: 57,
  	          column: 50
  	        }
  	      },
  	      '6': {
  	        start: {
  	          line: 57,
  	          column: 25
  	        },
  	        end: {
  	          line: 57,
  	          column: 50
  	        }
  	      },
  	      '7': {
  	        start: {
  	          line: 68,
  	          column: 22
  	        },
  	        end: {
  	          line: 68,
  	          column: 90
  	        }
  	      },
  	      '8': {
  	        start: {
  	          line: 68,
  	          column: 29
  	        },
  	        end: {
  	          line: 68,
  	          column: 90
  	        }
  	      },
  	      '9': {
  	        start: {
  	          line: 82,
  	          column: 20
  	        },
  	        end: {
  	          line: 97,
  	          column: 1
  	        }
  	      },
  	      '10': {
  	        start: {
  	          line: 85,
  	          column: 2
  	        },
  	        end: {
  	          line: 87,
  	          column: 3
  	        }
  	      },
  	      '11': {
  	        start: {
  	          line: 86,
  	          column: 4
  	        },
  	        end: {
  	          line: 86,
  	          column: 17
  	        }
  	      },
  	      '12': {
  	        start: {
  	          line: 91,
  	          column: 2
  	        },
  	        end: {
  	          line: 93,
  	          column: 3
  	        }
  	      },
  	      '13': {
  	        start: {
  	          line: 92,
  	          column: 4
  	        },
  	        end: {
  	          line: 92,
  	          column: 56
  	        }
  	      },
  	      '14': {
  	        start: {
  	          line: 96,
  	          column: 2
  	        },
  	        end: {
  	          line: 96,
  	          column: 32
  	        }
  	      },
  	      '15': {
  	        start: {
  	          line: 102,
  	          column: 27
  	        },
  	        end: {
  	          line: 337,
  	          column: 1
  	        }
  	      },
  	      '16': {
  	        start: {
  	          line: 103,
  	          column: 26
  	        },
  	        end: {
  	          line: 103,
  	          column: 28
  	        }
  	      },
  	      '17': {
  	        start: {
  	          line: 105,
  	          column: 17
  	        },
  	        end: {
  	          line: 105,
  	          column: 22
  	        }
  	      },
  	      '18': {
  	        start: {
  	          line: 107,
  	          column: 18
  	        },
  	        end: {
  	          line: 107,
  	          column: 22
  	        }
  	      },
  	      '19': {
  	        start: {
  	          line: 121,
  	          column: 29
  	        },
  	        end: {
  	          line: 178,
  	          column: 3
  	        }
  	      },
  	      '20': {
  	        start: {
  	          line: 122,
  	          column: 4
  	        },
  	        end: {
  	          line: 177,
  	          column: 6
  	        }
  	      },
  	      '21': {
  	        start: {
  	          line: 125,
  	          column: 6
  	        },
  	        end: {
  	          line: 127,
  	          column: 7
  	        }
  	      },
  	      '22': {
  	        start: {
  	          line: 126,
  	          column: 8
  	        },
  	        end: {
  	          line: 126,
  	          column: 15
  	        }
  	      },
  	      '23': {
  	        start: {
  	          line: 129,
  	          column: 29
  	        },
  	        end: {
  	          line: 129,
  	          column: 51
  	        }
  	      },
  	      '24': {
  	        start: {
  	          line: 130,
  	          column: 26
  	        },
  	        end: {
  	          line: 130,
  	          column: 43
  	        }
  	      },
  	      '25': {
  	        start: {
  	          line: 134,
  	          column: 19
  	        },
  	        end: {
  	          line: 134,
  	          column: 26
  	        }
  	      },
  	      '26': {
  	        start: {
  	          line: 138,
  	          column: 31
  	        },
  	        end: {
  	          line: 141,
  	          column: 7
  	        }
  	      },
  	      '27': {
  	        start: {
  	          line: 145,
  	          column: 30
  	        },
  	        end: {
  	          line: 160,
  	          column: 7
  	        }
  	      },
  	      '28': {
  	        start: {
  	          line: 146,
  	          column: 24
  	        },
  	        end: {
  	          line: 146,
  	          column: 57
  	        }
  	      },
  	      '29': {
  	        start: {
  	          line: 149,
  	          column: 8
  	        },
  	        end: {
  	          line: 151,
  	          column: 9
  	        }
  	      },
  	      '30': {
  	        start: {
  	          line: 150,
  	          column: 10
  	        },
  	        end: {
  	          line: 150,
  	          column: 17
  	        }
  	      },
  	      '31': {
  	        start: {
  	          line: 153,
  	          column: 8
  	        },
  	        end: {
  	          line: 155,
  	          column: 9
  	        }
  	      },
  	      '32': {
  	        start: {
  	          line: 154,
  	          column: 10
  	        },
  	        end: {
  	          line: 154,
  	          column: 28
  	        }
  	      },
  	      '33': {
  	        start: {
  	          line: 157,
  	          column: 8
  	        },
  	        end: {
  	          line: 159,
  	          column: 9
  	        }
  	      },
  	      '34': {
  	        start: {
  	          line: 158,
  	          column: 10
  	        },
  	        end: {
  	          line: 158,
  	          column: 39
  	        }
  	      },
  	      '35': {
  	        start: {
  	          line: 165,
  	          column: 6
  	        },
  	        end: {
  	          line: 165,
  	          column: 51
  	        }
  	      },
  	      '36': {
  	        start: {
  	          line: 169,
  	          column: 6
  	        },
  	        end: {
  	          line: 171,
  	          column: 7
  	        }
  	      },
  	      '37': {
  	        start: {
  	          line: 170,
  	          column: 8
  	        },
  	        end: {
  	          line: 170,
  	          column: 26
  	        }
  	      },
  	      '38': {
  	        start: {
  	          line: 173,
  	          column: 6
  	        },
  	        end: {
  	          line: 173,
  	          column: 33
  	        }
  	      },
  	      '39': {
  	        start: {
  	          line: 174,
  	          column: 6
  	        },
  	        end: {
  	          line: 174,
  	          column: 33
  	        }
  	      },
  	      '40': {
  	        start: {
  	          line: 176,
  	          column: 6
  	        },
  	        end: {
  	          line: 176,
  	          column: 30
  	        }
  	      },
  	      '41': {
  	        start: {
  	          line: 180,
  	          column: 2
  	        },
  	        end: {
  	          line: 237,
  	          column: 4
  	        }
  	      },
  	      '42': {
  	        start: {
  	          line: 188,
  	          column: 6
  	        },
  	        end: {
  	          line: 188,
  	          column: 40
  	        }
  	      },
  	      '43': {
  	        start: {
  	          line: 189,
  	          column: 6
  	        },
  	        end: {
  	          line: 189,
  	          column: 28
  	        }
  	      },
  	      '44': {
  	        start: {
  	          line: 190,
  	          column: 6
  	        },
  	        end: {
  	          line: 190,
  	          column: 22
  	        }
  	      },
  	      '45': {
  	        start: {
  	          line: 191,
  	          column: 6
  	        },
  	        end: {
  	          line: 191,
  	          column: 22
  	        }
  	      },
  	      '46': {
  	        start: {
  	          line: 201,
  	          column: 6
  	        },
  	        end: {
  	          line: 201,
  	          column: 22
  	        }
  	      },
  	      '47': {
  	        start: {
  	          line: 211,
  	          column: 6
  	        },
  	        end: {
  	          line: 211,
  	          column: 23
  	        }
  	      },
  	      '48': {
  	        start: {
  	          line: 212,
  	          column: 6
  	        },
  	        end: {
  	          line: 212,
  	          column: 22
  	        }
  	      },
  	      '49': {
  	        start: {
  	          line: 222,
  	          column: 6
  	        },
  	        end: {
  	          line: 222,
  	          column: 23
  	        }
  	      },
  	      '50': {
  	        start: {
  	          line: 233,
  	          column: 6
  	        },
  	        end: {
  	          line: 233,
  	          column: 23
  	        }
  	      },
  	      '51': {
  	        start: {
  	          line: 254,
  	          column: 2
  	        },
  	        end: {
  	          line: 254,
  	          column: 39
  	        }
  	      },
  	      '52': {
  	        start: {
  	          line: 272,
  	          column: 2
  	        },
  	        end: {
  	          line: 272,
  	          column: 44
  	        }
  	      },
  	      '53': {
  	        start: {
  	          line: 275,
  	          column: 2
  	        },
  	        end: {
  	          line: 277,
  	          column: 5
  	        }
  	      },
  	      '54': {
  	        start: {
  	          line: 276,
  	          column: 4
  	        },
  	        end: {
  	          line: 276,
  	          column: 31
  	        }
  	      },
  	      '55': {
  	        start: {
  	          line: 279,
  	          column: 2
  	        },
  	        end: {
  	          line: 336,
  	          column: 5
  	        }
  	      },
  	      '56': {
  	        start: {
  	          line: 282,
  	          column: 4
  	        },
  	        end: {
  	          line: 288,
  	          column: 5
  	        }
  	      },
  	      '57': {
  	        start: {
  	          line: 287,
  	          column: 6
  	        },
  	        end: {
  	          line: 287,
  	          column: 13
  	        }
  	      },
  	      '58': {
  	        start: {
  	          line: 295,
  	          column: 4
  	        },
  	        end: {
  	          line: 301,
  	          column: 5
  	        }
  	      },
  	      '59': {
  	        start: {
  	          line: 299,
  	          column: 6
  	        },
  	        end: {
  	          line: 299,
  	          column: 24
  	        }
  	      },
  	      '60': {
  	        start: {
  	          line: 300,
  	          column: 6
  	        },
  	        end: {
  	          line: 300,
  	          column: 37
  	        }
  	      },
  	      '61': {
  	        start: {
  	          line: 305,
  	          column: 26
  	        },
  	        end: {
  	          line: 305,
  	          column: 28
  	        }
  	      },
  	      '62': {
  	        start: {
  	          line: 307,
  	          column: 28
  	        },
  	        end: {
  	          line: 308,
  	          column: 54
  	        }
  	      },
  	      '63': {
  	        start: {
  	          line: 308,
  	          column: 6
  	        },
  	        end: {
  	          line: 308,
  	          column: 54
  	        }
  	      },
  	      '64': {
  	        start: {
  	          line: 310,
  	          column: 4
  	        },
  	        end: {
  	          line: 310,
  	          column: 23
  	        }
  	      },
  	      '65': {
  	        start: {
  	          line: 311,
  	          column: 4
  	        },
  	        end: {
  	          line: 311,
  	          column: 43
  	        }
  	      },
  	      '66': {
  	        start: {
  	          line: 313,
  	          column: 4
  	        },
  	        end: {
  	          line: 335,
  	          column: 10
  	        }
  	      },
  	      '67': {
  	        start: {
  	          line: 314,
  	          column: 25
  	        },
  	        end: {
  	          line: 314,
  	          column: 42
  	        }
  	      },
  	      '68': {
  	        start: {
  	          line: 316,
  	          column: 6
  	        },
  	        end: {
  	          line: 316,
  	          column: 23
  	        }
  	      },
  	      '69': {
  	        start: {
  	          line: 317,
  	          column: 6
  	        },
  	        end: {
  	          line: 317,
  	          column: 28
  	        }
  	      },
  	      '70': {
  	        start: {
  	          line: 318,
  	          column: 6
  	        },
  	        end: {
  	          line: 318,
  	          column: 46
  	        }
  	      },
  	      '71': {
  	        start: {
  	          line: 320,
  	          column: 6
  	        },
  	        end: {
  	          line: 334,
  	          column: 7
  	        }
  	      },
  	      '72': {
  	        start: {
  	          line: 324,
  	          column: 8
  	        },
  	        end: {
  	          line: 324,
  	          column: 59
  	        }
  	      },
  	      '73': {
  	        start: {
  	          line: 324,
  	          column: 40
  	        },
  	        end: {
  	          line: 324,
  	          column: 57
  	        }
  	      },
  	      '74': {
  	        start: {
  	          line: 325,
  	          column: 8
  	        },
  	        end: {
  	          line: 325,
  	          column: 35
  	        }
  	      },
  	      '75': {
  	        start: {
  	          line: 327,
  	          column: 8
  	        },
  	        end: {
  	          line: 331,
  	          column: 11
  	        }
  	      },
  	      '76': {
  	        start: {
  	          line: 333,
  	          column: 8
  	        },
  	        end: {
  	          line: 333,
  	          column: 31
  	        }
  	      },
  	      '77': {
  	        start: {
  	          line: 339,
  	          column: 0
  	        },
  	        end: {
  	          line: 339,
  	          column: 37
  	        }
  	      },
  	      '78': {
  	        start: {
  	          line: 341,
  	          column: 0
  	        },
  	        end: {
  	          line: 341,
  	          column: 57
  	        }
  	      }
  	    },
  	    fnMap: {
  	      '0': {
  	        name: '(anonymous_0)',
  	        decl: {
  	          start: {
  	            line: 57,
  	            column: 18
  	          },
  	          end: {
  	            line: 57,
  	            column: 19
  	          }
  	        },
  	        loc: {
  	          start: {
  	            line: 57,
  	            column: 25
  	          },
  	          end: {
  	            line: 57,
  	            column: 50
  	          }
  	        },
  	        line: 57
  	      },
  	      '1': {
  	        name: '(anonymous_1)',
  	        decl: {
  	          start: {
  	            line: 68,
  	            column: 22
  	          },
  	          end: {
  	            line: 68,
  	            column: 23
  	          }
  	        },
  	        loc: {
  	          start: {
  	            line: 68,
  	            column: 29
  	          },
  	          end: {
  	            line: 68,
  	            column: 90
  	          }
  	        },
  	        line: 68
  	      },
  	      '2': {
  	        name: '(anonymous_2)',
  	        decl: {
  	          start: {
  	            line: 82,
  	            column: 20
  	          },
  	          end: {
  	            line: 82,
  	            column: 21
  	          }
  	        },
  	        loc: {
  	          start: {
  	            line: 82,
  	            column: 30
  	          },
  	          end: {
  	            line: 97,
  	            column: 1
  	          }
  	        },
  	        line: 82
  	      },
  	      '3': {
  	        name: '(anonymous_3)',
  	        decl: {
  	          start: {
  	            line: 102,
  	            column: 27
  	          },
  	          end: {
  	            line: 102,
  	            column: 28
  	          }
  	        },
  	        loc: {
  	          start: {
  	            line: 102,
  	            column: 38
  	          },
  	          end: {
  	            line: 337,
  	            column: 1
  	          }
  	        },
  	        line: 102
  	      },
  	      '4': {
  	        name: '(anonymous_4)',
  	        decl: {
  	          start: {
  	            line: 121,
  	            column: 29
  	          },
  	          end: {
  	            line: 121,
  	            column: 30
  	          }
  	        },
  	        loc: {
  	          start: {
  	            line: 121,
  	            column: 40
  	          },
  	          end: {
  	            line: 178,
  	            column: 3
  	          }
  	        },
  	        line: 121
  	      },
  	      '5': {
  	        name: '(anonymous_5)',
  	        decl: {
  	          start: {
  	            line: 122,
  	            column: 11
  	          },
  	          end: {
  	            line: 122,
  	            column: 12
  	          }
  	        },
  	        loc: {
  	          start: {
  	            line: 122,
  	            column: 35
  	          },
  	          end: {
  	            line: 177,
  	            column: 5
  	          }
  	        },
  	        line: 122
  	      },
  	      '6': {
  	        name: '(anonymous_6)',
  	        decl: {
  	          start: {
  	            line: 145,
  	            column: 30
  	          },
  	          end: {
  	            line: 145,
  	            column: 31
  	          }
  	        },
  	        loc: {
  	          start: {
  	            line: 145,
  	            column: 46
  	          },
  	          end: {
  	            line: 160,
  	            column: 7
  	          }
  	        },
  	        line: 145
  	      },
  	      '7': {
  	        name: 'disable',
  	        decl: {
  	          start: {
  	            line: 187,
  	            column: 41
  	          },
  	          end: {
  	            line: 187,
  	            column: 48
  	          }
  	        },
  	        loc: {
  	          start: {
  	            line: 187,
  	            column: 51
  	          },
  	          end: {
  	            line: 192,
  	            column: 5
  	          }
  	        },
  	        line: 187
  	      },
  	      '8': {
  	        name: '(anonymous_8)',
  	        decl: {
  	          start: {
  	            line: 275,
  	            column: 21
  	          },
  	          end: {
  	            line: 275,
  	            column: 22
  	          }
  	        },
  	        loc: {
  	          start: {
  	            line: 275,
  	            column: 27
  	          },
  	          end: {
  	            line: 277,
  	            column: 3
  	          }
  	        },
  	        line: 275
  	      },
  	      '9': {
  	        name: '(anonymous_9)',
  	        decl: {
  	          start: {
  	            line: 279,
  	            column: 32
  	          },
  	          end: {
  	            line: 279,
  	            column: 33
  	          }
  	        },
  	        loc: {
  	          start: {
  	            line: 279,
  	            column: 39
  	          },
  	          end: {
  	            line: 336,
  	            column: 3
  	          }
  	        },
  	        line: 279
  	      },
  	      '10': {
  	        name: '(anonymous_10)',
  	        decl: {
  	          start: {
  	            line: 307,
  	            column: 28
  	          },
  	          end: {
  	            line: 307,
  	            column: 29
  	          }
  	        },
  	        loc: {
  	          start: {
  	            line: 308,
  	            column: 6
  	          },
  	          end: {
  	            line: 308,
  	            column: 54
  	          }
  	        },
  	        line: 308
  	      },
  	      '11': {
  	        name: '(anonymous_11)',
  	        decl: {
  	          start: {
  	            line: 313,
  	            column: 37
  	          },
  	          end: {
  	            line: 313,
  	            column: 38
  	          }
  	        },
  	        loc: {
  	          start: {
  	            line: 313,
  	            column: 43
  	          },
  	          end: {
  	            line: 335,
  	            column: 5
  	          }
  	        },
  	        line: 313
  	      },
  	      '12': {
  	        name: '(anonymous_12)',
  	        decl: {
  	          start: {
  	            line: 324,
  	            column: 32
  	          },
  	          end: {
  	            line: 324,
  	            column: 33
  	          }
  	        },
  	        loc: {
  	          start: {
  	            line: 324,
  	            column: 40
  	          },
  	          end: {
  	            line: 324,
  	            column: 57
  	          }
  	        },
  	        line: 324
  	      }
  	    },
  	    branchMap: {
  	      '0': {
  	        loc: {
  	          start: {
  	            line: 7,
  	            column: 23
  	          },
  	          end: {
  	            line: 7,
  	            column: 63
  	          }
  	        },
  	        type: 'binary-expr',
  	        locations: [{
  	          start: {
  	            line: 7,
  	            column: 23
  	          },
  	          end: {
  	            line: 7,
  	            column: 45
  	          }
  	        }, {
  	          start: {
  	            line: 7,
  	            column: 49
  	          },
  	          end: {
  	            line: 7,
  	            column: 63
  	          }
  	        }],
  	        line: 7
  	      },
  	      '1': {
  	        loc: {
  	          start: {
  	            line: 68,
  	            column: 29
  	          },
  	          end: {
  	            line: 68,
  	            column: 90
  	          }
  	        },
  	        type: 'binary-expr',
  	        locations: [{
  	          start: {
  	            line: 68,
  	            column: 29
  	          },
  	          end: {
  	            line: 68,
  	            column: 49
  	          }
  	        }, {
  	          start: {
  	            line: 68,
  	            column: 53
  	          },
  	          end: {
  	            line: 68,
  	            column: 90
  	          }
  	        }],
  	        line: 68
  	      },
  	      '2': {
  	        loc: {
  	          start: {
  	            line: 85,
  	            column: 2
  	          },
  	          end: {
  	            line: 87,
  	            column: 3
  	          }
  	        },
  	        type: 'if',
  	        locations: [{
  	          start: {
  	            line: 85,
  	            column: 2
  	          },
  	          end: {
  	            line: 87,
  	            column: 3
  	          }
  	        }, {
  	          start: {
  	            line: 85,
  	            column: 2
  	          },
  	          end: {
  	            line: 87,
  	            column: 3
  	          }
  	        }],
  	        line: 85
  	      },
  	      '3': {
  	        loc: {
  	          start: {
  	            line: 91,
  	            column: 2
  	          },
  	          end: {
  	            line: 93,
  	            column: 3
  	          }
  	        },
  	        type: 'if',
  	        locations: [{
  	          start: {
  	            line: 91,
  	            column: 2
  	          },
  	          end: {
  	            line: 93,
  	            column: 3
  	          }
  	        }, {
  	          start: {
  	            line: 91,
  	            column: 2
  	          },
  	          end: {
  	            line: 93,
  	            column: 3
  	          }
  	        }],
  	        line: 91
  	      },
  	      '4': {
  	        loc: {
  	          start: {
  	            line: 92,
  	            column: 11
  	          },
  	          end: {
  	            line: 92,
  	            column: 55
  	          }
  	        },
  	        type: 'binary-expr',
  	        locations: [{
  	          start: {
  	            line: 92,
  	            column: 11
  	          },
  	          end: {
  	            line: 92,
  	            column: 29
  	          }
  	        }, {
  	          start: {
  	            line: 92,
  	            column: 33
  	          },
  	          end: {
  	            line: 92,
  	            column: 55
  	          }
  	        }],
  	        line: 92
  	      },
  	      '5': {
  	        loc: {
  	          start: {
  	            line: 125,
  	            column: 6
  	          },
  	          end: {
  	            line: 127,
  	            column: 7
  	          }
  	        },
  	        type: 'if',
  	        locations: [{
  	          start: {
  	            line: 125,
  	            column: 6
  	          },
  	          end: {
  	            line: 127,
  	            column: 7
  	          }
  	        }, {
  	          start: {
  	            line: 125,
  	            column: 6
  	          },
  	          end: {
  	            line: 127,
  	            column: 7
  	          }
  	        }],
  	        line: 125
  	      },
  	      '6': {
  	        loc: {
  	          start: {
  	            line: 139,
  	            column: 8
  	          },
  	          end: {
  	            line: 139,
  	            column: 37
  	          }
  	        },
  	        type: 'cond-expr',
  	        locations: [{
  	          start: {
  	            line: 139,
  	            column: 25
  	          },
  	          end: {
  	            line: 139,
  	            column: 29
  	          }
  	        }, {
  	          start: {
  	            line: 139,
  	            column: 32
  	          },
  	          end: {
  	            line: 139,
  	            column: 37
  	          }
  	        }],
  	        line: 139
  	      },
  	      '7': {
  	        loc: {
  	          start: {
  	            line: 149,
  	            column: 8
  	          },
  	          end: {
  	            line: 151,
  	            column: 9
  	          }
  	        },
  	        type: 'if',
  	        locations: [{
  	          start: {
  	            line: 149,
  	            column: 8
  	          },
  	          end: {
  	            line: 151,
  	            column: 9
  	          }
  	        }, {
  	          start: {
  	            line: 149,
  	            column: 8
  	          },
  	          end: {
  	            line: 151,
  	            column: 9
  	          }
  	        }],
  	        line: 149
  	      },
  	      '8': {
  	        loc: {
  	          start: {
  	            line: 153,
  	            column: 8
  	          },
  	          end: {
  	            line: 155,
  	            column: 9
  	          }
  	        },
  	        type: 'if',
  	        locations: [{
  	          start: {
  	            line: 153,
  	            column: 8
  	          },
  	          end: {
  	            line: 155,
  	            column: 9
  	          }
  	        }, {
  	          start: {
  	            line: 153,
  	            column: 8
  	          },
  	          end: {
  	            line: 155,
  	            column: 9
  	          }
  	        }],
  	        line: 153
  	      },
  	      '9': {
  	        loc: {
  	          start: {
  	            line: 153,
  	            column: 12
  	          },
  	          end: {
  	            line: 153,
  	            column: 28
  	          }
  	        },
  	        type: 'binary-expr',
  	        locations: [{
  	          start: {
  	            line: 153,
  	            column: 12
  	          },
  	          end: {
  	            line: 153,
  	            column: 19
  	          }
  	        }, {
  	          start: {
  	            line: 153,
  	            column: 23
  	          },
  	          end: {
  	            line: 153,
  	            column: 28
  	          }
  	        }],
  	        line: 153
  	      },
  	      '10': {
  	        loc: {
  	          start: {
  	            line: 157,
  	            column: 8
  	          },
  	          end: {
  	            line: 159,
  	            column: 9
  	          }
  	        },
  	        type: 'if',
  	        locations: [{
  	          start: {
  	            line: 157,
  	            column: 8
  	          },
  	          end: {
  	            line: 159,
  	            column: 9
  	          }
  	        }, {
  	          start: {
  	            line: 157,
  	            column: 8
  	          },
  	          end: {
  	            line: 159,
  	            column: 9
  	          }
  	        }],
  	        line: 157
  	      },
  	      '11': {
  	        loc: {
  	          start: {
  	            line: 169,
  	            column: 6
  	          },
  	          end: {
  	            line: 171,
  	            column: 7
  	          }
  	        },
  	        type: 'if',
  	        locations: [{
  	          start: {
  	            line: 169,
  	            column: 6
  	          },
  	          end: {
  	            line: 171,
  	            column: 7
  	          }
  	        }, {
  	          start: {
  	            line: 169,
  	            column: 6
  	          },
  	          end: {
  	            line: 171,
  	            column: 7
  	          }
  	        }],
  	        line: 169
  	      },
  	      '12': {
  	        loc: {
  	          start: {
  	            line: 282,
  	            column: 4
  	          },
  	          end: {
  	            line: 288,
  	            column: 5
  	          }
  	        },
  	        type: 'if',
  	        locations: [{
  	          start: {
  	            line: 282,
  	            column: 4
  	          },
  	          end: {
  	            line: 288,
  	            column: 5
  	          }
  	        }, {
  	          start: {
  	            line: 282,
  	            column: 4
  	          },
  	          end: {
  	            line: 288,
  	            column: 5
  	          }
  	        }],
  	        line: 282
  	      },
  	      '13': {
  	        loc: {
  	          start: {
  	            line: 283,
  	            column: 6
  	          },
  	          end: {
  	            line: 285,
  	            column: 26
  	          }
  	        },
  	        type: 'binary-expr',
  	        locations: [{
  	          start: {
  	            line: 283,
  	            column: 6
  	          },
  	          end: {
  	            line: 283,
  	            column: 40
  	          }
  	        }, {
  	          start: {
  	            line: 284,
  	            column: 6
  	          },
  	          end: {
  	            line: 284,
  	            column: 20
  	          }
  	        }, {
  	          start: {
  	            line: 285,
  	            column: 6
  	          },
  	          end: {
  	            line: 285,
  	            column: 26
  	          }
  	        }],
  	        line: 283
  	      },
  	      '14': {
  	        loc: {
  	          start: {
  	            line: 295,
  	            column: 4
  	          },
  	          end: {
  	            line: 301,
  	            column: 5
  	          }
  	        },
  	        type: 'if',
  	        locations: [{
  	          start: {
  	            line: 295,
  	            column: 4
  	          },
  	          end: {
  	            line: 301,
  	            column: 5
  	          }
  	        }, {
  	          start: {
  	            line: 295,
  	            column: 4
  	          },
  	          end: {
  	            line: 301,
  	            column: 5
  	          }
  	        }],
  	        line: 295
  	      },
  	      '15': {
  	        loc: {
  	          start: {
  	            line: 296,
  	            column: 6
  	          },
  	          end: {
  	            line: 297,
  	            column: 42
  	          }
  	        },
  	        type: 'binary-expr',
  	        locations: [{
  	          start: {
  	            line: 296,
  	            column: 6
  	          },
  	          end: {
  	            line: 296,
  	            column: 15
  	          }
  	        }, {
  	          start: {
  	            line: 297,
  	            column: 6
  	          },
  	          end: {
  	            line: 297,
  	            column: 42
  	          }
  	        }],
  	        line: 296
  	      },
  	      '16': {
  	        loc: {
  	          start: {
  	            line: 320,
  	            column: 6
  	          },
  	          end: {
  	            line: 334,
  	            column: 7
  	          }
  	        },
  	        type: 'if',
  	        locations: [{
  	          start: {
  	            line: 320,
  	            column: 6
  	          },
  	          end: {
  	            line: 334,
  	            column: 7
  	          }
  	        }, {
  	          start: {
  	            line: 320,
  	            column: 6
  	          },
  	          end: {
  	            line: 334,
  	            column: 7
  	          }
  	        }],
  	        line: 320
  	      },
  	      '17': {
  	        loc: {
  	          start: {
  	            line: 320,
  	            column: 10
  	          },
  	          end: {
  	            line: 320,
  	            column: 48
  	          }
  	        },
  	        type: 'binary-expr',
  	        locations: [{
  	          start: {
  	            line: 320,
  	            column: 10
  	          },
  	          end: {
  	            line: 320,
  	            column: 20
  	          }
  	        }, {
  	          start: {
  	            line: 320,
  	            column: 24
  	          },
  	          end: {
  	            line: 320,
  	            column: 48
  	          }
  	        }],
  	        line: 320
  	      }
  	    },
  	    s: {
  	      '0': 0,
  	      '1': 0,
  	      '2': 0,
  	      '3': 0,
  	      '4': 0,
  	      '5': 0,
  	      '6': 0,
  	      '7': 0,
  	      '8': 0,
  	      '9': 0,
  	      '10': 0,
  	      '11': 0,
  	      '12': 0,
  	      '13': 0,
  	      '14': 0,
  	      '15': 0,
  	      '16': 0,
  	      '17': 0,
  	      '18': 0,
  	      '19': 0,
  	      '20': 0,
  	      '21': 0,
  	      '22': 0,
  	      '23': 0,
  	      '24': 0,
  	      '25': 0,
  	      '26': 0,
  	      '27': 0,
  	      '28': 0,
  	      '29': 0,
  	      '30': 0,
  	      '31': 0,
  	      '32': 0,
  	      '33': 0,
  	      '34': 0,
  	      '35': 0,
  	      '36': 0,
  	      '37': 0,
  	      '38': 0,
  	      '39': 0,
  	      '40': 0,
  	      '41': 0,
  	      '42': 0,
  	      '43': 0,
  	      '44': 0,
  	      '45': 0,
  	      '46': 0,
  	      '47': 0,
  	      '48': 0,
  	      '49': 0,
  	      '50': 0,
  	      '51': 0,
  	      '52': 0,
  	      '53': 0,
  	      '54': 0,
  	      '55': 0,
  	      '56': 0,
  	      '57': 0,
  	      '58': 0,
  	      '59': 0,
  	      '60': 0,
  	      '61': 0,
  	      '62': 0,
  	      '63': 0,
  	      '64': 0,
  	      '65': 0,
  	      '66': 0,
  	      '67': 0,
  	      '68': 0,
  	      '69': 0,
  	      '70': 0,
  	      '71': 0,
  	      '72': 0,
  	      '73': 0,
  	      '74': 0,
  	      '75': 0,
  	      '76': 0,
  	      '77': 0,
  	      '78': 0
  	    },
  	    f: {
  	      '0': 0,
  	      '1': 0,
  	      '2': 0,
  	      '3': 0,
  	      '4': 0,
  	      '5': 0,
  	      '6': 0,
  	      '7': 0,
  	      '8': 0,
  	      '9': 0,
  	      '10': 0,
  	      '11': 0,
  	      '12': 0
  	    },
  	    b: {
  	      '0': [0, 0],
  	      '1': [0, 0],
  	      '2': [0, 0],
  	      '3': [0, 0],
  	      '4': [0, 0],
  	      '5': [0, 0],
  	      '6': [0, 0],
  	      '7': [0, 0],
  	      '8': [0, 0],
  	      '9': [0, 0],
  	      '10': [0, 0],
  	      '11': [0, 0],
  	      '12': [0, 0],
  	      '13': [0, 0, 0],
  	      '14': [0, 0],
  	      '15': [0, 0],
  	      '16': [0, 0],
  	      '17': [0, 0]
  	    },
  	    _coverageSchema: '332fd63041d2c1bcb487cc26dd0d5f7d97098a6c'
  	  },
  	      coverage = global[gcv] || (global[gcv] = {});
  
  	  if (coverage[path] && coverage[path].hash === hash) {
  	    return coverage[path];
  	  }
  
  	  coverageData.hash = hash;
  	  return coverage[path] = coverageData;
  	}();
  	var Html5 = (cov_1ynxojh1tt.s[0]++, videojs.getTech('Html5'));
  	var registerPlugin = (cov_1ynxojh1tt.s[1]++, (cov_1ynxojh1tt.b[0][0]++, videojs.registerPlugin) || (cov_1ynxojh1tt.b[0][1]++, videojs.plugin));
  	var CHANGE_DETECT_EVENTS = (cov_1ynxojh1tt.s[2]++, ['abort', 'emptied', 'loadstart', 'play']);
  	var UNSTABLE_EVENTS = (cov_1ynxojh1tt.s[3]++, ['abort', 'emptied']);
  	var AD_STATES = (cov_1ynxojh1tt.s[4]++, ['ad-playback', 'ads-ready?', 'postroll?', 'preroll?']);
  	cov_1ynxojh1tt.s[5]++;
  
  	var isAdState = function isAdState(s) {
  	  cov_1ynxojh1tt.f[0]++;
  	  cov_1ynxojh1tt.s[6]++;
  	  return AD_STATES.indexOf(s) > -1;
  	};
  
  	cov_1ynxojh1tt.s[7]++;
  
  	var usingAds6Plus = function usingAds6Plus(p) {
  	  cov_1ynxojh1tt.f[1]++;
  	  cov_1ynxojh1tt.s[8]++;
  	  return (cov_1ynxojh1tt.b[1][0]++, p.usingPlugin('ads')) && (cov_1ynxojh1tt.b[1][1]++, typeof p.ads.inAdBreak === 'function');
  	};
  
  	cov_1ynxojh1tt.s[9]++;
  
  	var ignoreEvent = function ignoreEvent(p, e) {
  	  cov_1ynxojh1tt.f[2]++;
  	  cov_1ynxojh1tt.s[10]++;
  
  	  if (!p.usingPlugin('ads')) {
  	    cov_1ynxojh1tt.b[2][0]++;
  	    cov_1ynxojh1tt.s[11]++;
  	    return false;
  	  } else {
  	    cov_1ynxojh1tt.b[2][1]++;
  	  }
  
  	  cov_1ynxojh1tt.s[12]++;
  
  	  if (usingAds6Plus(p)) {
  	    cov_1ynxojh1tt.b[3][0]++;
  	    cov_1ynxojh1tt.s[13]++;
  	    return (cov_1ynxojh1tt.b[4][0]++, p.ads.isInAdMode()) && (cov_1ynxojh1tt.b[4][1]++, e.type !== 'loadstart');
  	  } else {
  	    cov_1ynxojh1tt.b[3][1]++;
  	  }
  
  	  cov_1ynxojh1tt.s[14]++;
  	  return isAdState(p.ads.state);
  	};
  
  	cov_1ynxojh1tt.s[15]++;
  
  	var perSourceBehaviors = function perSourceBehaviors() {
  	  var _this2 = this;
  
  	  cov_1ynxojh1tt.f[3]++;
  	  var perSrcListeners = (cov_1ynxojh1tt.s[16]++, []);
  	  var cachedSrc;
  
  	  var _disabled = (cov_1ynxojh1tt.s[17]++, false);
  
  	  var srcChangeTimer;
  	  var srcStable = (cov_1ynxojh1tt.s[18]++, true);
  	  cov_1ynxojh1tt.s[19]++;
  
  	  var createPerSrcBinder = function createPerSrcBinder(isOne) {
  	    cov_1ynxojh1tt.f[4]++;
  	    cov_1ynxojh1tt.s[20]++;
  	    return function (first, second) {
  	      var _this = this;
  
  	      cov_1ynxojh1tt.f[5]++;
  	      cov_1ynxojh1tt.s[21]++;
  
  	      if (this.perSourceBehaviors.disabled()) {
  	        cov_1ynxojh1tt.b[5][0]++;
  	        cov_1ynxojh1tt.s[22]++;
  	        return;
  	      } else {
  	        cov_1ynxojh1tt.b[5][1]++;
  	      }
  
  	      var isTargetPlayer = (cov_1ynxojh1tt.s[23]++, arguments.length === 2);
  	      var originalSrc = (cov_1ynxojh1tt.s[24]++, this.currentSrc());
  	      var args = (cov_1ynxojh1tt.s[25]++, [first]);
  	      var originalListener = (cov_1ynxojh1tt.s[26]++, videojs.bind(isTargetPlayer ? (cov_1ynxojh1tt.b[6][0]++, this) : (cov_1ynxojh1tt.b[6][1]++, first), arguments[arguments.length - 1]));
  	      cov_1ynxojh1tt.s[27]++;
  
  	      var wrappedListener = function wrappedListener() {
  	        cov_1ynxojh1tt.f[6]++;
  	        var changed = (cov_1ynxojh1tt.s[28]++, _this.currentSrc() !== originalSrc);
  	        cov_1ynxojh1tt.s[29]++;
  
  	        if (_this.perSourceBehaviors.disabled()) {
  	          cov_1ynxojh1tt.b[7][0]++;
  	          cov_1ynxojh1tt.s[30]++;
  	          return;
  	        } else {
  	          cov_1ynxojh1tt.b[7][1]++;
  	        }
  
  	        cov_1ynxojh1tt.s[31]++;
  
  	        if ((cov_1ynxojh1tt.b[9][0]++, changed) || (cov_1ynxojh1tt.b[9][1]++, isOne)) {
  	          cov_1ynxojh1tt.b[8][0]++;
  	          cov_1ynxojh1tt.s[32]++;
  
  	          _this.off.apply(_this, args);
  	        } else {
  	          cov_1ynxojh1tt.b[8][1]++;
  	        }
  
  	        cov_1ynxojh1tt.s[33]++;
  
  	        if (!changed) {
  	          cov_1ynxojh1tt.b[10][0]++;
  	          cov_1ynxojh1tt.s[34]++;
  	          originalListener.apply(void 0, arguments);
  	        } else {
  	          cov_1ynxojh1tt.b[10][1]++;
  	        }
  	      };
  
  	      cov_1ynxojh1tt.s[35]++;
  	      wrappedListener.guid = originalListener.guid;
  	      cov_1ynxojh1tt.s[36]++;
  
  	      if (!isTargetPlayer) {
  	        cov_1ynxojh1tt.b[11][0]++;
  	        cov_1ynxojh1tt.s[37]++;
  	        args.push(second);
  	      } else {
  	        cov_1ynxojh1tt.b[11][1]++;
  	      }
  
  	      cov_1ynxojh1tt.s[38]++;
  	      args.push(wrappedListener);
  	      cov_1ynxojh1tt.s[39]++;
  	      perSrcListeners.push(args);
  	      cov_1ynxojh1tt.s[40]++;
  	      return this.on.apply(this, args);
  	    };
  	  };
  
  	  cov_1ynxojh1tt.s[41]++;
  	  this.perSourceBehaviors = {
  	    disable: videojs.bind(this, function disable() {
  	      cov_1ynxojh1tt.f[7]++;
  	      cov_1ynxojh1tt.s[42]++;
  	      this.clearTimeout(srcChangeTimer);
  	      cov_1ynxojh1tt.s[43]++;
  	      srcChangeTimer = null;
  	      cov_1ynxojh1tt.s[44]++;
  	      _disabled = true;
  	      cov_1ynxojh1tt.s[45]++;
  	      return _disabled;
  	    }),
  	    disabled: function disabled() {
  	      cov_1ynxojh1tt.s[46]++;
  	      return _disabled;
  	    },
  	    enable: function enable() {
  	      cov_1ynxojh1tt.s[47]++;
  	      _disabled = false;
  	      cov_1ynxojh1tt.s[48]++;
  	      return _disabled;
  	    },
  	    enabled: function enabled() {
  	      cov_1ynxojh1tt.s[49]++;
  	      return !_disabled;
  	    },
  	    isSrcStable: function isSrcStable() {
  	      cov_1ynxojh1tt.s[50]++;
  	      return srcStable;
  	    },
  	    VERSION: version
  	  };
  	  cov_1ynxojh1tt.s[51]++;
  	  this.onPerSrc = createPerSrcBinder();
  	  cov_1ynxojh1tt.s[52]++;
  	  this.onePerSrc = createPerSrcBinder(true);
  	  cov_1ynxojh1tt.s[53]++;
  	  this.on('dispose', function () {
  	    cov_1ynxojh1tt.f[8]++;
  	    cov_1ynxojh1tt.s[54]++;
  	    perSrcListeners.length = 0;
  	  });
  	  cov_1ynxojh1tt.s[55]++;
  	  this.on(CHANGE_DETECT_EVENTS, function (e) {
  	    cov_1ynxojh1tt.f[9]++;
  	    cov_1ynxojh1tt.s[56]++;
  
  	    if ((cov_1ynxojh1tt.b[13][0]++, _this2.perSourceBehaviors.disabled()) || (cov_1ynxojh1tt.b[13][1]++, srcChangeTimer) || (cov_1ynxojh1tt.b[13][2]++, ignoreEvent(_this2, e))) {
  	      cov_1ynxojh1tt.b[12][0]++;
  	      cov_1ynxojh1tt.s[57]++;
  	      return;
  	    } else {
  	      cov_1ynxojh1tt.b[12][1]++;
  	    }
  
  	    cov_1ynxojh1tt.s[58]++;
  
  	    if ((cov_1ynxojh1tt.b[15][0]++, srcStable) && (cov_1ynxojh1tt.b[15][1]++, UNSTABLE_EVENTS.indexOf(e.type) > -1)) {
  	      cov_1ynxojh1tt.b[14][0]++;
  	      cov_1ynxojh1tt.s[59]++;
  	      srcStable = false;
  	      cov_1ynxojh1tt.s[60]++;
  
  	      _this2.trigger('sourceunstable');
  	    } else {
  	      cov_1ynxojh1tt.b[14][1]++;
  	    }
  
  	    var interimEvents = (cov_1ynxojh1tt.s[61]++, []);
  	    cov_1ynxojh1tt.s[62]++;
  
  	    var addInterimEvent = function addInterimEvent(f) {
  	      cov_1ynxojh1tt.f[10]++;
  	      cov_1ynxojh1tt.s[63]++;
  	      return interimEvents.push({
  	        time: Date.now(),
  	        event: f
  	      });
  	    };
  
  	    cov_1ynxojh1tt.s[64]++;
  	    addInterimEvent(e);
  	    cov_1ynxojh1tt.s[65]++;
  
  	    _this2.on(Html5.Events, addInterimEvent);
  
  	    cov_1ynxojh1tt.s[66]++;
  	    srcChangeTimer = _this2.setTimeout(function () {
  	      cov_1ynxojh1tt.f[11]++;
  	      var currentSrc = (cov_1ynxojh1tt.s[67]++, _this2.currentSrc());
  	      cov_1ynxojh1tt.s[68]++;
  	      srcStable = true;
  	      cov_1ynxojh1tt.s[69]++;
  	      srcChangeTimer = null;
  	      cov_1ynxojh1tt.s[70]++;
  
  	      _this2.off(Html5.Events, addInterimEvent);
  
  	      cov_1ynxojh1tt.s[71]++;
  
  	      if ((cov_1ynxojh1tt.b[17][0]++, currentSrc) && (cov_1ynxojh1tt.b[17][1]++, currentSrc !== cachedSrc)) {
  	        cov_1ynxojh1tt.b[16][0]++;
  	        cov_1ynxojh1tt.s[72]++;
  	        perSrcListeners.forEach(function (args) {
  	          cov_1ynxojh1tt.f[12]++;
  	          cov_1ynxojh1tt.s[73]++;
  	          return _this2.off.apply(_this2, args);
  	        });
  	        cov_1ynxojh1tt.s[74]++;
  	        perSrcListeners.length = 0;
  	        cov_1ynxojh1tt.s[75]++;
  
  	        _this2.trigger('sourcechanged', {
  	          interimEvents: interimEvents,
  	          from: cachedSrc,
  	          to: currentSrc
  	        });
  
  	        cov_1ynxojh1tt.s[76]++;
  	        cachedSrc = currentSrc;
  	      } else {
  	        cov_1ynxojh1tt.b[16][1]++;
  	      }
  	    }, 1);
  	  });
  	};
  
  	cov_1ynxojh1tt.s[77]++;
  	perSourceBehaviors.VERSION = version;
  	cov_1ynxojh1tt.s[78]++;
  	registerPlugin('perSourceBehaviors', perSourceBehaviors);
  
  	/**
  	 * Assertion for testing a subset of event data.
  	 *
  	 * @param  {Object} data
  	 * @param  {Object} expected
  	 * @param  {string} [message]
  	 */
  
  	QUnit.assert.eventDataMatches = function (data, expected, message) {
  	  this.deepEqual({
  	    from: data.from,
  	    to: data.to,
  	    // Convert interimEvents to extract only `time` and `type`.
  	    interimEvents: data.interimEvents.map(function (o) {
  	      return {
  	        time: o.time,
  	        type: o.event.type
  	      };
  	    })
  	  }, expected, message);
  	};
  
  	QUnit.test('the environment is sane', function (assert) {
  	  assert.strictEqual(typeof Array.isArray, 'function', 'es5 exists');
  	  assert.strictEqual(typeof sinon, 'object', 'sinon exists');
  	  assert.strictEqual(typeof videojs, 'function', 'videojs exists');
  	  assert.strictEqual(typeof perSourceBehaviors, 'function', 'plugin is a function');
  	});
  	QUnit.module('videojs-per-source-behaviors', {
  	  beforeEach: function beforeEach() {
  	    // Mock the environment's timers because certain things - particularly
  	    // player readiness - are asynchronous in video.js 5. This MUST come
  	    // before any player is created; otherwise, timers could get created
  	    // with the actual timer methods!
  	    this.clock = sinon.useFakeTimers();
  	    this.fixture = document_1.getElementById('qunit-fixture');
  	    this.video = document_1.createElement('video');
  	    this.fixture.appendChild(this.video);
  	    this.player = videojs(this.video);
  	    this.player.perSourceBehaviors(); // Tick forward enough to ready the player.
  
  	    this.clock.tick(1);
  	  },
  	  afterEach: function afterEach() {
  	    this.player.dispose();
  	    this.clock.restore();
  	  }
  	});
  	QUnit.test('disable(), disabled(), enable()', function (assert) {
  	  var psb = this.player.perSourceBehaviors;
  	  assert.notOk(psb.disabled(), 'by default, per-source behaviors are not disabled');
  	  psb.disable();
  	  assert.ok(psb.disabled(), 'per-source behaviors can be disabled');
  	  psb.enable();
  	  assert.notOk(psb.disabled(), 'per-source behaviors can be enabled');
  	});
  	QUnit.test('"sourceunstable" event', function (assert) {
  	  var spy = sinon.spy();
  	  this.player.on('sourceunstable', spy);
  	  this.player.trigger('abort'); // For each assertion, tick 10ms to be sure multiple timeouts do not happen!
  
  	  this.clock.tick(10);
  	  assert.strictEqual(spy.callCount, 1, '"sourceunstable" events can be triggered by "abort"');
  	  this.player.trigger('emptied');
  	  this.clock.tick(10);
  	  assert.strictEqual(spy.callCount, 2, '"sourceunstable" events can be triggered by "emptied"');
  	  this.player.trigger('abort');
  	  this.player.trigger('emptied');
  	  this.player.trigger('abort');
  	  this.player.trigger('emptied');
  	  this.clock.tick(10);
  	  assert.strictEqual(spy.callCount, 3, '"sourceunstable" events will only trigger once during a stack');
  	});
  	QUnit.test('"sourcechanged" event', function (assert) {
  	  var spy = sinon.spy();
  	  this.player.on('sourcechanged', spy);
  	  this.player.trigger('loadstart');
  	  this.player.trigger('canplay');
  	  this.player.trigger('play');
  	  this.player.trigger('playing'); // For each assertion, tick 10ms to be sure multiple timeouts do not happen!
  
  	  this.clock.tick(10);
  	  assert.strictEqual(spy.callCount, 0, 'no source, no "sourcechanged" event');
  
  	  this.player.currentSrc = function () {
  	    return 'x-1.mp4';
  	  };
  
  	  this.player.trigger('play');
  	  this.player.trigger('playing');
  	  this.player.trigger('loadstart');
  	  this.player.trigger('canplay');
  	  this.clock.tick(10);
  	  assert.strictEqual(spy.callCount, 1, 'with a source, got a "sourcechanged" event');
  	  assert.eventDataMatches(spy.getCall(0).args[1], {
  	    from: undefined,
  	    to: 'x-1.mp4',
  	    interimEvents: [{
  	      time: 11,
  	      type: 'play'
  	    }, {
  	      time: 11,
  	      type: 'playing'
  	    }, {
  	      time: 11,
  	      type: 'loadstart'
  	    }, {
  	      time: 11,
  	      type: 'canplay'
  	    }]
  	  });
  	  this.player.trigger('pause');
  	  this.player.trigger('emptied');
  	  this.player.trigger('abort');
  	  this.player.trigger('loadstart');
  	  this.clock.tick(10);
  	  assert.strictEqual(spy.callCount, 1, 'subsequent events with same source do not trigger "sourcechanged"');
  
  	  this.player.currentSrc = function () {
  	    return 'x-2.mp4';
  	  };
  
  	  this.player.trigger('loadstart');
  	  this.player.trigger('loadedmetadata');
  	  this.player.trigger('loadeddata');
  	  this.clock.tick(10);
  	  assert.strictEqual(spy.callCount, 2, 'with a new source, got a "sourcechanged" event');
  	  assert.eventDataMatches(spy.getCall(1).args[1], {
  	    from: 'x-1.mp4',
  	    to: 'x-2.mp4',
  	    interimEvents: [{
  	      time: 31,
  	      type: 'loadstart'
  	    }, {
  	      time: 31,
  	      type: 'loadedmetadata'
  	    }, {
  	      time: 31,
  	      type: 'loadeddata'
  	    }]
  	  });
  
  	  this.player.currentSrc = function () {
  	    return 'x-1.mp4';
  	  };
  
  	  this.player.trigger('play');
  	  this.player.trigger('canplay');
  	  this.player.trigger('loadstart');
  	  this.clock.tick(10);
  	  assert.strictEqual(spy.callCount, 3, 'with a changed, but repeated, source, got a "sourcechanged" event');
  	  assert.eventDataMatches(spy.getCall(2).args[1], {
  	    from: 'x-2.mp4',
  	    to: 'x-1.mp4',
  	    interimEvents: [{
  	      time: 41,
  	      type: 'play'
  	    }, {
  	      time: 41,
  	      type: 'canplay'
  	    }, {
  	      time: 41,
  	      type: 'loadstart'
  	    }]
  	  }); // The "play" will trigger a listener
  
  	  this.player.trigger('play');
  	  this.player.trigger('canplay');
  
  	  this.player.currentSrc = function () {
  	    return 'x-2.mp4';
  	  };
  
  	  this.player.trigger('playing');
  	  this.player.trigger('loadstart');
  	  this.clock.tick(10);
  	  assert.strictEqual(spy.callCount, 4, 'changing the source while a timeout was queued triggered a "sourcechanged" event');
  	  assert.eventDataMatches(spy.getCall(3).args[1], {
  	    from: 'x-1.mp4',
  	    to: 'x-2.mp4',
  	    interimEvents: [{
  	      time: 51,
  	      type: 'play'
  	    }, {
  	      time: 51,
  	      type: 'canplay'
  	    }, {
  	      time: 51,
  	      type: 'playing'
  	    }, {
  	      time: 51,
  	      type: 'loadstart'
  	    }]
  	  });
  	  this.player.perSourceBehaviors.disable();
  
  	  this.player.currentSrc = function () {
  	    return 'x-1.mp4';
  	  };
  
  	  this.player.trigger('loadedmetadata');
  	  this.player.trigger('loadeddata');
  	  this.player.trigger('loadstart');
  	  this.clock.tick(10);
  	  assert.strictEqual(spy.callCount, 4, 'changing the source while per-source behaviors are disabled does NOT ' + 'trigger a "sourcechanged" event');
  	  this.player.perSourceBehaviors.enable();
  	  this.player.trigger('play');
  	  this.player.trigger('loadstart');
  	  this.player.trigger('canplay');
  	  this.player.trigger('playing');
  	  this.clock.tick(10);
  	  assert.strictEqual(spy.callCount, 5, 're-enabling per-source behaviors will start triggering "sourcechanged" ' + 'events once again');
  	  assert.eventDataMatches(spy.getCall(4).args[1], {
  	    from: 'x-2.mp4',
  	    to: 'x-1.mp4',
  	    interimEvents: [{
  	      time: 71,
  	      type: 'play'
  	    }, {
  	      time: 71,
  	      type: 'loadstart'
  	    }, {
  	      time: 71,
  	      type: 'canplay'
  	    }, {
  	      time: 71,
  	      type: 'playing'
  	    }]
  	  });
  
  	  this.player.currentSrc = function () {
  	    return 'x-1.mp4';
  	  };
  
  	  this.player.addClass('vjs-ad-loading');
  	  this.player.trigger('loadstart');
  	  this.clock.tick(10);
  	  assert.strictEqual(spy.callCount, 5, 'changing the source with the vjs-ad-loading class on the player does NOT ' + 'trigger the "sourcechanged" event');
  	  this.player.removeClass('vjs-ad-loading');
  	  this.player.addClass('vjs-ad-playing');
  	  this.player.trigger('play');
  	  this.clock.tick(10);
  	  assert.strictEqual(spy.callCount, 5, 'changing the source with the vjs-ad-playing class on the player does NOT ' + 'trigger the "sourcechanged" event');
  	});
  	QUnit.test('onPerSrc() event binding', function (assert) {
  	  var spy = sinon.spy();
  
  	  this.player.currentSrc = function () {
  	    return 'x-1.mp4';
  	  };
  
  	  this.player.onPerSrc('foo', spy);
  	  this.player.trigger('foo');
  	  this.player.trigger('foo');
  	  assert.strictEqual(spy.callCount, 2, 'an onPerSrc listener is called each time the event is triggered ' + 'while source is unchanged');
  
  	  this.player.currentSrc = function () {
  	    return 'x-2.mp4';
  	  };
  
  	  this.player.trigger('foo');
  	  assert.strictEqual(spy.callCount, 2, 'an onPerSrc listener is not called if the event is triggered for ' + 'a new source');
  
  	  this.player.currentSrc = function () {
  	    return 'x-1.mp4';
  	  };
  
  	  this.player.trigger('foo');
  	  assert.strictEqual(spy.callCount, 2, 'restoring an old source, which had a listener does not trigger - ' + 'the binding is gone');
  
  	  this.player.currentSrc = function () {};
  
  	  this.player.onPerSrc('foo', spy);
  	  this.player.trigger('foo');
  	  assert.strictEqual(spy.callCount, 3, 'an onPerSrc listener does not care if there actually is a source');
  
  	  this.player.currentSrc = function () {
  	    return 'x-3.mp4';
  	  };
  
  	  this.player.trigger('foo');
  	  assert.strictEqual(spy.callCount, 3, 'but gaining a source still clears the previous listener'); // Bind a new onPerSrc listener for the latest source, then disable per-
  	  // source behaviors.
  
  	  this.player.onPerSrc('foo', spy);
  	  this.player.perSourceBehaviors.disable();
  	  this.player.trigger('foo');
  	  assert.strictEqual(spy.callCount, 3, 'when per-source behaviors are disabled, listeners are not triggered');
  	  this.player.perSourceBehaviors.enable();
  	  this.player.trigger('foo');
  	  assert.strictEqual(spy.callCount, 4, 'when per-source behaviors are re-enabled, listeners are triggered');
  	});
  	QUnit.test('onePerSrc() event binding', function (assert) {
  	  var spy = sinon.spy();
  
  	  this.player.currentSrc = function () {
  	    return 'x-1.mp4';
  	  };
  
  	  this.player.onePerSrc('foo', spy);
  	  this.player.trigger('foo');
  	  this.player.trigger('foo');
  	  this.player.trigger('foo');
  	  this.player.trigger('foo');
  	  assert.strictEqual(spy.callCount, 1, 'an onePerSrc listener is called only once no matter how often the ' + 'event is triggered while source is unchanged');
  
  	  this.player.currentSrc = function () {
  	    return 'x-2.mp4';
  	  };
  
  	  this.player.trigger('foo');
  	  assert.strictEqual(spy.callCount, 1, 'an onePerSrc listener is not called if the event is triggered for' + 'a new source');
  
  	  this.player.currentSrc = function () {
  	    return 'x-1.mp4';
  	  };
  
  	  this.player.trigger('foo');
  	  assert.strictEqual(spy.callCount, 1, 'restoring an old source, which had a listener does not trigger - ' + 'the binding is gone');
  
  	  this.player.currentSrc = function () {};
  
  	  this.player.onePerSrc('foo', spy);
  	  this.player.trigger('foo');
  	  assert.strictEqual(spy.callCount, 2, 'an onePerSrc listener does not care if there actually is a source');
  
  	  this.player.currentSrc = function () {
  	    return 'x-3.mp4';
  	  };
  
  	  this.player.trigger('foo');
  	  assert.strictEqual(spy.callCount, 2, 'but gaining a source still clears the previous listener'); // Bind a new onePerSrc listener for the latest source, then disable per-
  	  // source behaviors.
  
  	  this.player.onePerSrc('foo', spy);
  	  this.player.perSourceBehaviors.disable();
  	  this.player.trigger('foo');
  	  assert.strictEqual(spy.callCount, 2, 'when per-source behaviors are disabled, listeners are not triggered');
  	  this.player.perSourceBehaviors.enable();
  	  this.player.trigger('foo');
  	  assert.strictEqual(spy.callCount, 3, 'when per-source behaviors are re-enabled, listeners are triggered');
  	});
  	QUnit.test('"sourcechanged" removes per-source listeners', function (assert) {
  	  var spy = sinon.spy();
  
  	  this.player.currentSrc = function () {
  	    return 'x-1.mp4';
  	  };
  
  	  this.player.onPerSrc('foo', spy);
  	  this.player.onePerSrc('foo', spy); // Cause a "sourcechanged" event to trigger. This won't work by simply
  	  // triggering the event. It needs to happen before the event.
  
  	  this.player.currentSrc = function () {
  	    return 'x-2.mp4';
  	  };
  
  	  this.player.trigger('loadstart');
  	  this.clock.tick(10);
  	  this.player.trigger('foo');
  	  assert.strictEqual(spy.callCount, 0, 'per source listeners were not called');
  	});
  
  	var triggerSeriesMaker = function triggerSeriesMaker(player) {
  	  return function (series) {
  	    series.forEach(function (item) {
  	      return player.trigger(item);
  	    });
  	  };
  	};
  	/**
  	 * Assertion for testing a subset of event data.
  	 *
  	 * @param  {Object} data
  	 * @param  {Object} expected
  	 * @param  {string} [message]
  	 */
  
  
  	QUnit.assert.eventDataMatches = function (data, expected, message) {
  	  this.deepEqual({
  	    from: data.from,
  	    to: data.to,
  	    // Convert interimEvents to extract only `time` and `type`.
  	    interimEvents: data.interimEvents.map(function (o) {
  	      return {
  	        time: o.time,
  	        type: o.event.type
  	      };
  	    })
  	  }, expected, message);
  	};
  
  	QUnit.test('the environment is sane', function (assert) {
  	  assert.strictEqual(typeof Array.isArray, 'function', 'es5 exists');
  	  assert.strictEqual(typeof sinon, 'object', 'sinon exists');
  	  assert.strictEqual(typeof videojs, 'function', 'videojs exists');
  	  assert.strictEqual(typeof perSourceBehaviors, 'function', 'plugin is a function');
  	});
  	QUnit.module('sourcechanged matrix', {
  	  beforeEach: function beforeEach() {
  	    var _this = this;
  
  	    // Mock the environment's timers because certain things - particularly
  	    // player readiness - are asynchronous in video.js 5. This MUST come
  	    // before any player is created; otherwise, timers could get created
  	    // with the actual timer methods!
  	    this.clock = sinon.useFakeTimers();
  	    this.fixture = document_1.getElementById('qunit-fixture');
  	    this.video = document_1.createElement('video');
  	    this.fixture.appendChild(this.video);
  	    this.player = videojs(this.video); // Mock the usingPlugin method in a way that makes it easier to override
  	    // the `ads` property of the player without losing plugin detection
  	    // capabilities.
  
  	    this.player.usingPlugin = function (name) {
  	      return name === 'ads' ? !!_this.player.ads : videojs.getComponent('Player').prototype.usingPlugin.call(_this.player, name);
  	    };
  
  	    this.player.perSourceBehaviors(); // Tick forward enough to ready the player.
  
  	    this.clock.tick(1);
  	  },
  	  afterEach: function afterEach() {
  	    this.player.dispose();
  	    this.clock.restore();
  	  }
  	});
  	QUnit.test('previous-null, current-null, no-ads', function (assert) {
  	  var spy = sinon.stub();
  	  this.player.on('sourcechanged', spy);
  	  var triggerSeries = triggerSeriesMaker(this.player);
  	  triggerSeries(['loadstart', 'canplay', 'play', 'playing']);
  	  this.clock.tick(10);
  	  assert.deepEqual(spy.callCount, 0, 'previous-null, current-null, no-ads, no sourcechanged event');
  	});
  	QUnit.test('previous-null, current-foo.mp4, no-ads', function (assert) {
  	  var spy = sinon.stub();
  	  this.player.on('sourcechanged', spy);
  	  var triggerSeries = triggerSeriesMaker(this.player);
  
  	  this.player.currentSrc = function () {
  	    return 'foo.mp4';
  	  };
  
  	  triggerSeries(['loadstart', 'canplay', 'play', 'playing']);
  	  this.clock.tick(10);
  	  assert.deepEqual(spy.callCount, 1, 'previous-null, current-foo.mp4, no-ads, sourcechanged event');
  	});
  	QUnit.test('previous-null, current-ad.mp4, ads-preroll', function (assert) {
  	  var spy = sinon.stub();
  	  this.player.on('sourcechanged', spy);
  	  var triggerSeries = triggerSeriesMaker(this.player);
  	  this.player.ads = {
  	    state: 'preroll?'
  	  };
  
  	  this.player.currentSrc = function () {
  	    return 'ad.mp4';
  	  };
  
  	  triggerSeries(['loadstart', 'canplay', 'play', 'playing']);
  	  this.clock.tick(10);
  	  assert.deepEqual(spy.callCount, 0, 'previous-null, current-ad.mp4, ads-preroll, no sourcechanged event');
  	});
  	QUnit.test('previous-null, current-ad.mp4, ads-postroll', function (assert) {
  	  var spy = sinon.stub();
  	  this.player.on('sourcechanged', spy);
  	  var triggerSeries = triggerSeriesMaker(this.player);
  	  this.player.ads = {
  	    state: 'postroll?'
  	  };
  
  	  this.player.currentSrc = function () {
  	    return 'ad.mp4';
  	  };
  
  	  triggerSeries(['loadstart', 'canplay', 'play', 'playing']);
  	  this.clock.tick(10);
  	  assert.deepEqual(spy.callCount, 0, 'previous-null, current-ad.mp4, ads-postroll, no sourcechanged event');
  	});
  	QUnit.test('previous-null, current-ad.mp4, ads-ad-playback', function (assert) {
  	  var spy = sinon.stub();
  	  this.player.on('sourcechanged', spy);
  	  var triggerSeries = triggerSeriesMaker(this.player);
  	  this.player.ads = {
  	    state: 'ad-playback'
  	  };
  
  	  this.player.currentSrc = function () {
  	    return 'ad.mp4';
  	  };
  
  	  triggerSeries(['loadstart', 'canplay', 'play', 'playing']);
  	  this.clock.tick(10);
  	  assert.deepEqual(spy.callCount, 0, 'previous-null, current-ad.mp4, ads-ad-playback, no sourcechanged event');
  	});
  	QUnit.test('previous-null, current-foo.mp4, no-ads (ads-ready)', function (assert) {
  	  var spy = sinon.stub();
  	  this.player.on('sourcechanged', spy);
  	  var triggerSeries = triggerSeriesMaker(this.player);
  	  this.player.ads = {
  	    state: 'ads-ready'
  	  };
  
  	  this.player.currentSrc = function () {
  	    return 'foo.mp4';
  	  };
  
  	  triggerSeries(['loadstart', 'canplay', 'play', 'playing']);
  	  this.clock.tick(10);
  	  assert.deepEqual(spy.callCount, 1, 'previous-null, current-ad.mp4, no-ads (ads-ready), no sourcechanged event');
  	});
  	QUnit.test('previous-foo.mp4, current-foo.mp4, no-ads', function (assert) {
  	  var spy = sinon.stub();
  	  this.player.on('sourcechanged', spy);
  	  var triggerSeries = triggerSeriesMaker(this.player);
  
  	  this.player.currentSrc = function () {
  	    return 'foo.mp4';
  	  };
  
  	  triggerSeries(['loadstart', 'canplay', 'play', 'playing']);
  	  this.clock.tick(10); // we don't care about the first video, only the current one
  
  	  spy.reset();
  
  	  this.player.currentSrc = function () {
  	    return 'foo.mp4';
  	  };
  
  	  triggerSeries(['loadstart', 'canplay', 'play', 'playing']);
  	  this.clock.tick(10);
  	  assert.deepEqual(spy.callCount, 0, 'previous-foo.mp4, current-foo.mp4, no-ads, no sourcechanged event');
  	});
  	QUnit.test('previous-foo.mp4, current-foo.mp4, ads-preroll', function (assert) {
  	  var spy = sinon.stub();
  	  this.player.on('sourcechanged', spy);
  	  var triggerSeries = triggerSeriesMaker(this.player);
  
  	  this.player.currentSrc = function () {
  	    return 'foo.mp4';
  	  };
  
  	  triggerSeries(['loadstart', 'canplay', 'play', 'playing']);
  	  this.clock.tick(10); // we don't care about the first video, only the current one
  
  	  spy.reset();
  	  this.player.ads = {
  	    state: 'preroll?'
  	  };
  
  	  this.player.currentSrc = function () {
  	    return 'foo.mp4';
  	  };
  
  	  triggerSeries(['loadstart', 'canplay', 'play', 'playing']);
  	  this.clock.tick(10);
  	  assert.deepEqual(spy.callCount, 0, 'previous-foo.mp4, current-foo.mp4, ads-preroll, no sourcechanged event');
  	});
  	QUnit.test('previous-foo.mp4, current-foo.mp4, ads-postroll', function (assert) {
  	  var spy = sinon.stub();
  	  this.player.on('sourcechanged', spy);
  	  var triggerSeries = triggerSeriesMaker(this.player);
  
  	  this.player.currentSrc = function () {
  	    return 'foo.mp4';
  	  };
  
  	  triggerSeries(['loadstart', 'canplay', 'play', 'playing']);
  	  this.clock.tick(10); // we don't care about the first video, only the current one
  
  	  spy.reset();
  	  this.player.ads = {
  	    state: 'postroll?'
  	  };
  
  	  this.player.currentSrc = function () {
  	    return 'foo.mp4';
  	  };
  
  	  triggerSeries(['loadstart', 'canplay', 'play', 'playing']);
  	  this.clock.tick(10);
  	  assert.deepEqual(spy.callCount, 0, 'previous-foo.mp4, current-foo.mp4, ads-postroll, no sourcechanged event');
  	});
  	QUnit.test('previous-foo.mp4, current-foo.mp4, ads-ad-playback', function (assert) {
  	  var spy = sinon.stub();
  	  this.player.on('sourcechanged', spy);
  	  var triggerSeries = triggerSeriesMaker(this.player);
  
  	  this.player.currentSrc = function () {
  	    return 'foo.mp4';
  	  };
  
  	  triggerSeries(['loadstart', 'canplay', 'play', 'playing']);
  	  this.clock.tick(10); // we don't care about the first video, only the current one
  
  	  spy.reset();
  	  this.player.ads = {
  	    state: 'ad-playback'
  	  };
  
  	  this.player.currentSrc = function () {
  	    return 'foo.mp4';
  	  };
  
  	  triggerSeries(['loadstart', 'canplay', 'play', 'playing']);
  	  this.clock.tick(10);
  	  assert.deepEqual(spy.callCount, 0, 'previous-foo.mp4, current-foo.mp4, ads-ad-playback, no sourcechanged event');
  	});
  	QUnit.test('previous-foo.mp4, current-foo.mp4, no-ads (ads-ready)', function (assert) {
  	  var spy = sinon.stub();
  	  this.player.on('sourcechanged', spy);
  	  var triggerSeries = triggerSeriesMaker(this.player);
  
  	  this.player.currentSrc = function () {
  	    return 'foo.mp4';
  	  };
  
  	  triggerSeries(['loadstart', 'canplay', 'play', 'playing']);
  	  this.clock.tick(10); // we don't care about the first video, only the current one
  
  	  spy.reset();
  	  this.player.ads = {
  	    state: 'ads-ready'
  	  };
  
  	  this.player.currentSrc = function () {
  	    return 'foo.mp4';
  	  };
  
  	  triggerSeries(['loadstart', 'canplay', 'play', 'playing']);
  	  this.clock.tick(10);
  	  assert.deepEqual(spy.callCount, 0, 'previous-foo.mp4, current-foo.mp4, no-ads (ads-ready), sourcechanged event');
  	});
  	QUnit.test('previous-foo.mp4, current-bar.mp4, no-ads', function (assert) {
  	  var spy = sinon.stub();
  	  this.player.on('sourcechanged', spy);
  	  var triggerSeries = triggerSeriesMaker(this.player);
  
  	  this.player.currentSrc = function () {
  	    return 'foo.mp4';
  	  };
  
  	  triggerSeries(['loadstart', 'canplay', 'play', 'playing']);
  	  this.clock.tick(10); // we don't care about the first video, only the current one
  
  	  spy.reset();
  
  	  this.player.currentSrc = function () {
  	    return 'bar.mp4';
  	  };
  
  	  triggerSeries(['loadstart', 'canplay', 'play', 'playing']);
  	  this.clock.tick(10);
  	  assert.deepEqual(spy.callCount, 1, 'previous-foo.mp4, current-bar.mp4, no-ads, sourcechanged event');
  	});
  	QUnit.test('previous-foo.mp4, current-bar.mp4, ads-preroll', function (assert) {
  	  var spy = sinon.stub();
  	  this.player.on('sourcechanged', spy);
  	  var triggerSeries = triggerSeriesMaker(this.player);
  
  	  this.player.currentSrc = function () {
  	    return 'foo.mp4';
  	  };
  
  	  triggerSeries(['loadstart', 'canplay', 'play', 'playing']);
  	  this.clock.tick(10); // we don't care about the first video, only the current one
  
  	  spy.reset();
  	  this.player.ads = {
  	    state: 'preroll?'
  	  };
  
  	  this.player.currentSrc = function () {
  	    return 'bar.mp4';
  	  };
  
  	  triggerSeries(['loadstart', 'canplay', 'play', 'playing']);
  	  this.clock.tick(10);
  	  assert.deepEqual(spy.callCount, 0, 'previous-foo.mp4, current-bar.mp4, ads-preroll, no sourcechanged event');
  	});
  	QUnit.test('previous-foo.mp4, current-bar.mp4, ads-postroll', function (assert) {
  	  var spy = sinon.stub();
  	  this.player.on('sourcechanged', spy);
  	  var triggerSeries = triggerSeriesMaker(this.player);
  
  	  this.player.currentSrc = function () {
  	    return 'foo.mp4';
  	  };
  
  	  triggerSeries(['loadstart', 'canplay', 'play', 'playing']);
  	  this.clock.tick(10); // we don't care about the first video, only the current one
  
  	  spy.reset();
  	  this.player.ads = {
  	    state: 'postroll?'
  	  };
  
  	  this.player.currentSrc = function () {
  	    return 'foo.mp4';
  	  };
  
  	  triggerSeries(['loadstart', 'canplay', 'play', 'playing']);
  	  this.clock.tick(10);
  	  assert.deepEqual(spy.callCount, 0, 'previous-foo.mp4, current-foo.mp4, ads-postroll, no sourcechanged event');
  	});
  	QUnit.test('previous-foo.mp4, current-bar.mp4, ads-ad-playback', function (assert) {
  	  var spy = sinon.stub();
  	  this.player.on('sourcechanged', spy);
  	  var triggerSeries = triggerSeriesMaker(this.player);
  
  	  this.player.currentSrc = function () {
  	    return 'foo.mp4';
  	  };
  
  	  triggerSeries(['loadstart', 'canplay', 'play', 'playing']);
  	  this.clock.tick(10); // we don't care about the first video, only the current one
  
  	  spy.reset();
  	  this.player.ads = {
  	    state: 'ad-playback'
  	  };
  
  	  this.player.currentSrc = function () {
  	    return 'bar.mp4';
  	  };
  
  	  triggerSeries(['loadstart', 'canplay', 'play', 'playing']);
  	  this.clock.tick(10);
  	  assert.deepEqual(spy.callCount, 0, 'previous-foo.mp4, current-bar.mp4, ads-ad-playback, no sourcechanged event');
  	});
  	QUnit.test('previous-foo.mp4, current-bar.mp4, no-ads (ads-ready)', function (assert) {
  	  var spy = sinon.stub();
  	  this.player.on('sourcechanged', spy);
  	  var triggerSeries = triggerSeriesMaker(this.player);
  
  	  this.player.currentSrc = function () {
  	    return 'foo.mp4';
  	  };
  
  	  triggerSeries(['loadstart', 'canplay', 'play', 'playing']);
  	  this.clock.tick(10); // we don't care about the first video, only the current one
  
  	  spy.reset();
  	  this.player.ads = {
  	    state: 'ads-ready'
  	  };
  
  	  this.player.currentSrc = function () {
  	    return 'bar.mp4';
  	  };
  
  	  triggerSeries(['loadstart', 'canplay', 'play', 'playing']);
  	  this.clock.tick(10);
  	  assert.deepEqual(spy.callCount, 1, 'previous-foo.mp4, current-bar.mp4, no-ads (ads-ready), sourcechanged event');
  	});
  	QUnit.test('previous-foo.mp4, current-ad.mp4, ads-preroll', function (assert) {
  	  var spy = sinon.stub();
  	  this.player.on('sourcechanged', spy);
  	  var triggerSeries = triggerSeriesMaker(this.player);
  
  	  this.player.currentSrc = function () {
  	    return 'foo.mp4';
  	  };
  
  	  triggerSeries(['loadstart', 'canplay', 'play', 'playing']);
  	  this.clock.tick(10); // we don't care about the first video, only the current one
  
  	  spy.reset();
  	  this.player.ads = {
  	    state: 'preroll?'
  	  };
  
  	  this.player.currentSrc = function () {
  	    return 'ad.mp4';
  	  };
  
  	  triggerSeries(['loadstart', 'canplay', 'play', 'playing']);
  	  this.clock.tick(10);
  	  assert.deepEqual(spy.callCount, 0, 'previous-foo.mp4, current-ad.mp4, ads-preroll, no sourcechanged event');
  	});
  	QUnit.test('previous-foo.mp4, current-ad.mp4, ads-postroll', function (assert) {
  	  var spy = sinon.stub();
  	  this.player.on('sourcechanged', spy);
  	  var triggerSeries = triggerSeriesMaker(this.player);
  
  	  this.player.currentSrc = function () {
  	    return 'foo.mp4';
  	  };
  
  	  triggerSeries(['loadstart', 'canplay', 'play', 'playing']);
  	  this.clock.tick(10); // we don't care about the first video, only the current one
  
  	  spy.reset();
  	  this.player.ads = {
  	    state: 'postroll?'
  	  };
  
  	  this.player.currentSrc = function () {
  	    return 'ad.mp4';
  	  };
  
  	  triggerSeries(['loadstart', 'canplay', 'play', 'playing']);
  	  this.clock.tick(10);
  	  assert.deepEqual(spy.callCount, 0, 'previous-foo.mp4, current-foo.mp4, ads-postroll, no sourcechanged event');
  	});
  	QUnit.test('previous-foo.mp4, current-ad.mp4, ads-ad-playback', function (assert) {
  	  var spy = sinon.stub();
  	  this.player.on('sourcechanged', spy);
  	  var triggerSeries = triggerSeriesMaker(this.player);
  
  	  this.player.currentSrc = function () {
  	    return 'foo.mp4';
  	  };
  
  	  triggerSeries(['loadstart', 'canplay', 'play', 'playing']);
  	  this.clock.tick(10); // we don't care about the first video, only the current one
  
  	  spy.reset();
  	  this.player.ads = {
  	    state: 'ad-playback'
  	  };
  
  	  this.player.currentSrc = function () {
  	    return 'ad.mp4';
  	  };
  
  	  triggerSeries(['loadstart', 'canplay', 'play', 'playing']);
  	  this.clock.tick(10);
  	  assert.deepEqual(spy.callCount, 0, 'previous-foo.mp4, current-ad.mp4, ads-ad-playback, no sourcechanged event');
  	});
  	QUnit.test('previous-foo.mp4, current-ad.mp4, no-ads (ads-ready)', function (assert) {
  	  var spy = sinon.stub();
  	  this.player.on('sourcechanged', spy);
  	  var triggerSeries = triggerSeriesMaker(this.player);
  
  	  this.player.currentSrc = function () {
  	    return 'foo.mp4';
  	  };
  
  	  triggerSeries(['loadstart', 'canplay', 'play', 'playing']);
  	  this.clock.tick(10); // we don't care about the first video, only the current one
  
  	  spy.reset();
  	  this.player.ads = {
  	    state: 'ads-ready'
  	  };
  
  	  this.player.currentSrc = function () {
  	    return 'ad.mp4';
  	  };
  
  	  triggerSeries(['loadstart', 'canplay', 'play', 'playing']);
  	  this.clock.tick(10);
  	  assert.deepEqual(spy.callCount, 1, 'previous-foo.mp4, current-ad.mp4, no-ads (ads-ready), sourcechanged event');
  	});
  	QUnit.test('previous-ad.mp4, current-foo.mp4, ads-preroll', function (assert) {
  	  var spy = sinon.stub();
  	  this.player.on('sourcechanged', spy);
  	  var triggerSeries = triggerSeriesMaker(this.player);
  
  	  this.player.currentSrc = function () {
  	    return 'ad.mp4';
  	  };
  
  	  triggerSeries(['loadstart', 'canplay', 'play', 'playing']);
  	  this.clock.tick(10); // we don't care about the first video, only the current one
  
  	  spy.reset();
  	  this.player.ads = {
  	    state: 'preroll?'
  	  };
  
  	  this.player.currentSrc = function () {
  	    return 'foo.mp4';
  	  };
  
  	  triggerSeries(['loadstart', 'canplay', 'play', 'playing']);
  	  this.clock.tick(10);
  	  assert.deepEqual(spy.callCount, 0, 'previous-ad.mp4, current-foo.mp4, ads-preroll, no sourcechanged event');
  	});
  	QUnit.test('previous-ad.mp4, current-foo.mp4, ads-postroll', function (assert) {
  	  var spy = sinon.stub();
  	  this.player.on('sourcechanged', spy);
  	  var triggerSeries = triggerSeriesMaker(this.player);
  
  	  this.player.currentSrc = function () {
  	    return 'ad.mp4';
  	  };
  
  	  triggerSeries(['loadstart', 'canplay', 'play', 'playing']);
  	  this.clock.tick(10); // we don't care about the first video, only the current one
  
  	  spy.reset();
  	  this.player.ads = {
  	    state: 'postroll?'
  	  };
  
  	  this.player.currentSrc = function () {
  	    return 'foo.mp4';
  	  };
  
  	  triggerSeries(['loadstart', 'canplay', 'play', 'playing']);
  	  this.clock.tick(10);
  	  assert.deepEqual(spy.callCount, 0, 'previous-ad.mp4, current-foo.mp4, ads-postroll, no sourcechanged event');
  	});
  	QUnit.test('previous-ad.mp4, current-foo.mp4, ads-ad-playback', function (assert) {
  	  var spy = sinon.stub();
  	  this.player.on('sourcechanged', spy);
  	  var triggerSeries = triggerSeriesMaker(this.player);
  
  	  this.player.currentSrc = function () {
  	    return 'ad.mp4';
  	  };
  
  	  triggerSeries(['loadstart', 'canplay', 'play', 'playing']);
  	  this.clock.tick(10); // we don't care about the first video, only the current one
  
  	  spy.reset();
  	  this.player.ads = {
  	    state: 'ad-playback'
  	  };
  
  	  this.player.currentSrc = function () {
  	    return 'foo.mp4';
  	  };
  
  	  triggerSeries(['loadstart', 'canplay', 'play', 'playing']);
  	  this.clock.tick(10);
  	  assert.deepEqual(spy.callCount, 0, 'previous-ad.mp4, current-foo.mp4, ads-ad-playback, no sourcechanged event');
  	});
  	QUnit.test('previous-ad.mp4, current-foo.mp4, no-ads (ads-ready)', function (assert) {
  	  var spy = sinon.stub();
  	  this.player.on('sourcechanged', spy);
  	  var triggerSeries = triggerSeriesMaker(this.player);
  
  	  this.player.currentSrc = function () {
  	    return 'ad.mp4';
  	  };
  
  	  triggerSeries(['loadstart', 'canplay', 'play', 'playing']);
  	  this.clock.tick(10); // we don't care about the first video, only the current one
  
  	  spy.reset();
  	  this.player.ads = {
  	    state: 'ads-ready'
  	  };
  
  	  this.player.currentSrc = function () {
  	    return 'foo.mp4';
  	  };
  
  	  triggerSeries(['loadstart', 'canplay', 'play', 'playing']);
  	  this.clock.tick(10);
  	  assert.deepEqual(spy.callCount, 1, 'previous-foo.mp4, current-ad.mp4, no-ads (ads-ready), sourcechanged event');
  	});
  	QUnit.test('previous-null, current-foo.mp4, contrib-ads-6 isInAdMode => false (ignores ads state)', function (assert) {
  	  var spy = sinon.stub();
  	  this.player.on('sourcechanged', spy);
  	  var triggerSeries = triggerSeriesMaker(this.player);
  	  this.player.ads = {
  	    // Pick a state at odds with what is reported from isInAdMode
  	    state: 'preroll?',
  	    inAdBreak: function inAdBreak() {},
  	    isInAdMode: function isInAdMode() {
  	      return false;
  	    }
  	  };
  
  	  this.player.currentSrc = function () {
  	    return 'foo.mp4';
  	  };
  
  	  triggerSeries(['loadstart', 'canplay', 'play', 'playing']);
  	  this.clock.tick(10);
  	  assert.deepEqual(spy.callCount, 1, 'previous-null, current-foo.mp4, contrib-ads-6 isInAdMode => false (ignores ads state), sourcechanged event');
  	});
  	QUnit.test('previous-foo.mp4, current-foo.mp4, contrib-ads-6 isInAdMode => false (ignores ads state)', function (assert) {
  	  var spy = sinon.stub();
  	  this.player.on('sourcechanged', spy);
  	  var triggerSeries = triggerSeriesMaker(this.player);
  
  	  this.player.currentSrc = function () {
  	    return 'foo.mp4';
  	  };
  
  	  triggerSeries(['loadstart', 'canplay', 'play', 'playing']);
  	  this.clock.tick(10); // we don't care about the first video, only the current one
  
  	  spy.reset();
  	  this.player.ads = {
  	    // Pick a state at odds with what is reported from isInAdMode
  	    ads: 'preroll?',
  	    inAdBreak: function inAdBreak() {},
  	    isInAdMode: function isInAdMode() {
  	      return false;
  	    }
  	  };
  
  	  this.player.currentSrc = function () {
  	    return 'foo.mp4';
  	  };
  
  	  triggerSeries(['loadstart', 'canplay', 'play', 'playing']);
  	  this.clock.tick(10);
  	  assert.deepEqual(spy.callCount, 0, 'previous-foo.mp4, current-foo.mp4, contrib-ads-6 isInAdMode => false (ignores ads state), sourcechanged event');
  	});
  	QUnit.test('previous-null, current-foo.mp4, contrib-ads-6 isInAdMode => true (ignores ads state)', function (assert) {
  	  var spy = sinon.stub();
  	  this.player.on('sourcechanged', spy);
  	  var triggerSeries = triggerSeriesMaker(this.player);
  	  this.player.ads = {
  	    // Pick a state at odds with what is reported from isInAdMode
  	    state: 'content-playback',
  	    inAdBreak: function inAdBreak() {},
  	    isInAdMode: function isInAdMode() {
  	      return true;
  	    }
  	  };
  
  	  this.player.currentSrc = function () {
  	    return 'foo.mp4';
  	  };
  
  	  triggerSeries(['loadstart', 'canplay', 'play', 'playing']);
  	  this.clock.tick(10);
  	  assert.deepEqual(spy.callCount, 1, 'previous-null, current-foo.mp4, contrib-ads-6 isInAdMode => true (ignores ads state), sourcechanged event');
  	});
  	QUnit.test('previous-foo.mp4, current-foo.mp4, contrib-ads-6 isInAdMode => true (ignores ads state)', function (assert) {
  	  var spy = sinon.stub();
  	  this.player.on('sourcechanged', spy);
  	  var triggerSeries = triggerSeriesMaker(this.player);
  
  	  this.player.currentSrc = function () {
  	    return 'foo.mp4';
  	  };
  
  	  triggerSeries(['loadstart', 'canplay', 'play', 'playing']);
  	  this.clock.tick(10); // we don't care about the first video, only the current one
  
  	  spy.reset();
  	  this.player.ads = {
  	    // Pick a state at odds with what is reported from isInAdMode
  	    state: 'content-playback',
  	    inAdBreak: function inAdBreak() {},
  	    isInAdMode: function isInAdMode() {
  	      return true;
  	    }
  	  };
  
  	  this.player.currentSrc = function () {
  	    return 'foo.mp4';
  	  };
  
  	  triggerSeries(['loadstart', 'canplay', 'play', 'playing']);
  	  this.clock.tick(10);
  	  assert.deepEqual(spy.callCount, 0, 'previous-foo.mp4, current-foo.mp4, contrib-ads-6 isInAdMode => true (ignores ads state), sourcechanged event');
  	});
  
  }(QUnit,sinon,videojs));
  