OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 | 5 |
6 // This file provides common functions for media actions. | 6 // This file provides common functions for media actions. |
7 window.__findMediaElements = function(selector) { | 7 window.__findMediaElements = function(selector) { |
8 // Returns elements matching the selector, otherwise returns the first video | 8 // Returns elements matching the selector, otherwise returns the first video |
9 // or audio tag element that can be found. | 9 // or audio tag element that can be found. |
10 // If selector == 'all', returns all media elements. | 10 // If selector == 'all', returns all media elements. |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
50 window.__registerHTML5EventCompleted = function(element, event_name) { | 50 window.__registerHTML5EventCompleted = function(element, event_name) { |
51 // Logs |even_name| on element when completed. | 51 // Logs |even_name| on element when completed. |
52 var logEventHappened = function(e) { | 52 var logEventHappened = function(e) { |
53 element[e.type + '_completed'] = true; | 53 element[e.type + '_completed'] = true; |
54 element.removeEventListener(event_name, logEventHappened); | 54 element.removeEventListener(event_name, logEventHappened); |
55 } | 55 } |
56 element.addEventListener(event_name, logEventHappened); | 56 element.addEventListener(event_name, logEventHappened); |
57 }; | 57 }; |
58 | 58 |
59 window.__error = null; | 59 window.__error = null; |
OLD | NEW |