OLD | NEW |
| (Empty) |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | |
2 // Use of this source code is governed by a BSD-style license that can be | |
3 // found in the LICENSE file. | |
4 | |
5 // Test configuration used by test page to configure the player app and other | |
6 // test specific configurations. | |
7 function TestConfig() { | |
8 this.mediaFile = null; | |
9 this.keySystem = null; | |
10 this.mediaType = null; | |
11 this.licenseServerURL = null; | |
12 this.useMSE = false; | |
13 this.usePrefixedEME = false; | |
14 this.runFPS = false; | |
15 } | |
16 | |
17 TestConfig.prototype.loadQueryParams = function() { | |
18 // Load query parameters and set default values. | |
19 var r = /([^&=]+)=?([^&]*)/g; | |
20 // Lambda function for decoding extracted match values. Replaces '+' with | |
21 // space so decodeURIComponent functions properly. | |
22 var decodeURI = function decodeURI(s) { | |
23 return decodeURIComponent(s.replace(/\+/g, ' ')); | |
24 }; | |
25 var match; | |
26 while (match = r.exec(window.location.search.substring(1))) | |
27 this[decodeURI(match[1])] = decodeURI(match[2]); | |
28 this.useMSE = this.useMSE == '1' || this.useMSE == 'true'; | |
29 this.usePrefixedEME = | |
30 this.usePrefixedEME == '1' || this.usePrefixedEME == 'true'; | |
31 }; | |
OLD | NEW |