1 2<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> 3<html><head><title>Python: module telemetry.page.actions.play</title> 4</head><body bgcolor="#f0f0f8"> 5 6<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="heading"> 7<tr bgcolor="#7799ee"> 8<td valign=bottom> <br> 9<font color="#ffffff" face="helvetica, arial"> <br><big><big><strong><a href="telemetry.html"><font color="#ffffff">telemetry</font></a>.<a href="telemetry.page.html"><font color="#ffffff">page</font></a>.<a href="telemetry.page.actions.html"><font color="#ffffff">actions</font></a>.play</strong></big></big></font></td 10><td align=right valign=bottom 11><font color="#ffffff" face="helvetica, arial"><a href=".">index</a><br><a href="../telemetry/page/actions/play.py">telemetry/page/actions/play.py</a></font></td></tr></table> 12 <p><tt>A Telemetry page_action that performs the "play" action on media elements.<br> 13 <br> 14Media elements can be specified by a selector attribute. If no selector is<br> 15defined then then the action attempts to play the first video element or audio<br> 16element on the page. A selector can also be 'all' to play all media elements.<br> 17 <br> 18Other attributes to use are: wait_for_playing and wait_for_ended, which forces<br> 19the action to wait until playing and ended events get fired respectively.</tt></p> 20<p> 21<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section"> 22<tr bgcolor="#aa55cc"> 23<td colspan=3 valign=bottom> <br> 24<font color="#ffffff" face="helvetica, arial"><big><strong>Modules</strong></big></font></td></tr> 25 26<tr><td bgcolor="#aa55cc"><tt> </tt></td><td> </td> 27<td width="100%"><table width="100%" summary="list"><tr><td width="25%" valign=top><a href="telemetry.core.exceptions.html">telemetry.core.exceptions</a><br> 28</td><td width="25%" valign=top><a href="telemetry.page.actions.media_action.html">telemetry.page.actions.media_action</a><br> 29</td><td width="25%" valign=top><a href="telemetry.page.actions.page_action.html">telemetry.page.actions.page_action</a><br> 30</td><td width="25%" valign=top></td></tr></table></td></tr></table><p> 31<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section"> 32<tr bgcolor="#ee77aa"> 33<td colspan=3 valign=bottom> <br> 34<font color="#ffffff" face="helvetica, arial"><big><strong>Classes</strong></big></font></td></tr> 35 36<tr><td bgcolor="#ee77aa"><tt> </tt></td><td> </td> 37<td width="100%"><dl> 38<dt><font face="helvetica, arial"><a href="telemetry.page.actions.media_action.html#MediaAction">telemetry.page.actions.media_action.MediaAction</a>(<a href="telemetry.page.actions.page_action.html#PageAction">telemetry.page.actions.page_action.PageAction</a>) 39</font></dt><dd> 40<dl> 41<dt><font face="helvetica, arial"><a href="telemetry.page.actions.play.html#PlayAction">PlayAction</a> 42</font></dt></dl> 43</dd> 44</dl> 45 <p> 46<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section"> 47<tr bgcolor="#ffc8d8"> 48<td colspan=3 valign=bottom> <br> 49<font color="#000000" face="helvetica, arial"><a name="PlayAction">class <strong>PlayAction</strong></a>(<a href="telemetry.page.actions.media_action.html#MediaAction">telemetry.page.actions.media_action.MediaAction</a>)</font></td></tr> 50 51<tr><td bgcolor="#ffc8d8"><tt> </tt></td><td> </td> 52<td width="100%"><dl><dt>Method resolution order:</dt> 53<dd><a href="telemetry.page.actions.play.html#PlayAction">PlayAction</a></dd> 54<dd><a href="telemetry.page.actions.media_action.html#MediaAction">telemetry.page.actions.media_action.MediaAction</a></dd> 55<dd><a href="telemetry.page.actions.page_action.html#PageAction">telemetry.page.actions.page_action.PageAction</a></dd> 56<dd><a href="__builtin__.html#object">__builtin__.object</a></dd> 57</dl> 58<hr> 59Methods defined here:<br> 60<dl><dt><a name="PlayAction-RunAction"><strong>RunAction</strong></a>(self, page, tab)</dt></dl> 61 62<dl><dt><a name="PlayAction-WillRunAction"><strong>WillRunAction</strong></a>(self, page, tab)</dt><dd><tt>Load the media metrics JS code prior to running the action.</tt></dd></dl> 63 64<dl><dt><a name="PlayAction-__init__"><strong>__init__</strong></a>(self, attributes<font color="#909090">=None</font>)</dt></dl> 65 66<hr> 67Methods inherited from <a href="telemetry.page.actions.media_action.html#MediaAction">telemetry.page.actions.media_action.MediaAction</a>:<br> 68<dl><dt><a name="PlayAction-HasEventCompletedOrError"><strong>HasEventCompletedOrError</strong></a>(self, tab, selector, event_name)</dt></dl> 69 70<dl><dt><a name="PlayAction-LoadJS"><strong>LoadJS</strong></a>(self, tab, js_file_name)</dt><dd><tt>Loads and executes a JS file in the tab.</tt></dd></dl> 71 72<dl><dt><a name="PlayAction-WaitForEvent"><strong>WaitForEvent</strong></a>(self, tab, selector, event_name, timeout)</dt><dd><tt>Halts media action until the selector's event is fired.<br> 73 <br> 74Args:<br> 75 tab: The tab to check for event on.<br> 76 selector: Media element selector.<br> 77 event_name: Name of the event to check if fired or not.<br> 78 timeout: Timeout to check for event, throws an exception if not fired.</tt></dd></dl> 79 80<hr> 81Methods inherited from <a href="telemetry.page.actions.page_action.html#PageAction">telemetry.page.actions.page_action.PageAction</a>:<br> 82<dl><dt><a name="PlayAction-BindMeasurementJavaScript"><strong>BindMeasurementJavaScript</strong></a>(self, tab, start_js, stop_js)</dt><dd><tt>Let this action determine when measurements should start and stop.<br> 83 <br> 84A measurement can call this method to provide the action<br> 85with JavaScript code that starts and stops measurements. The action<br> 86determines when to execute the provided JavaScript code, for more accurate<br> 87timings.<br> 88 <br> 89Args:<br> 90 tab: The tab to do everything on.<br> 91 start_js: JavaScript code that starts measurements.<br> 92 stop_js: JavaScript code that stops measurements.</tt></dd></dl> 93 94<dl><dt><a name="PlayAction-CanBeBound"><strong>CanBeBound</strong></a>(self)</dt><dd><tt>If this class implements BindMeasurementJavaScript, override CanBeBound<br> 95to return True so that a test knows it can bind measurements.</tt></dd></dl> 96 97<dl><dt><a name="PlayAction-CleanUp"><strong>CleanUp</strong></a>(self, page, tab)</dt></dl> 98 99<dl><dt><a name="PlayAction-CustomizeBrowserOptionsForPageSet"><strong>CustomizeBrowserOptionsForPageSet</strong></a>(self, options)</dt><dd><tt>Override to add action-specific options to the BrowserOptions<br> 100object. These options will be set for the whole page set.<br> 101 <br> 102If the browser is not being restarted for every page in the page set then<br> 103all browser options required for the action must be set here. This, however,<br> 104requires that they do not conflict with options require by other actions<br> 105used up by the page set.</tt></dd></dl> 106 107<dl><dt><a name="PlayAction-GetActiveRangeOnTimeline"><strong>GetActiveRangeOnTimeline</strong></a>(self, timeline)</dt></dl> 108 109<dl><dt><a name="PlayAction-RunActionAndMaybeWait"><strong>RunActionAndMaybeWait</strong></a>(self, page, tab)</dt></dl> 110 111<dl><dt><a name="PlayAction-WillWaitAfterRun"><strong>WillWaitAfterRun</strong></a>(self)</dt></dl> 112 113<hr> 114Static methods inherited from <a href="telemetry.page.actions.page_action.html#PageAction">telemetry.page.actions.page_action.PageAction</a>:<br> 115<dl><dt><a name="PlayAction-ResetNextTimelineMarkerId"><strong>ResetNextTimelineMarkerId</strong></a>()</dt></dl> 116 117<hr> 118Data descriptors inherited from <a href="telemetry.page.actions.page_action.html#PageAction">telemetry.page.actions.page_action.PageAction</a>:<br> 119<dl><dt><strong>__dict__</strong></dt> 120<dd><tt>dictionary for instance variables (if defined)</tt></dd> 121</dl> 122<dl><dt><strong>__weakref__</strong></dt> 123<dd><tt>list of weak references to the object (if defined)</tt></dd> 124</dl> 125</td></tr></table></td></tr></table> 126</body></html>