| | 402 | // Update playback time |
| | 403 | |
| | 404 | public function processTimeEvent(associatedStreamIndex:int, timeEvent:TimeEvent):void; |
| | 405 | |
| | 406 | // Update player state |
| | 407 | |
| | 408 | public function onPlayerSeek(activeStreamIndex:int=-1, isAdSlotKey:Boolean = false, newTimePoint:Number=0):void; |
| | 409 | public function onPlayerMute(activeStreamIndex:int=-1, isAdSlotKey:Boolean = false):void; |
| | 410 | public function onPlayerUnmute(activeStreamIndex:int=-1, isAdSlotKey:Boolean = false):void; |
| | 411 | public function onPlayerStop(activeStreamIndex:int=-1, isAdSlotKey:Boolean = false):void; |
| | 412 | public function onPlayerResize(activeStreamIndex:int=-1, isAdSlotKey:Boolean = false):void; |
| | 413 | public function onPlayerFullscreenEntry(activeStreamIndex:int=-1, isAdSlotKey:Boolean = false):void; |
| | 414 | public function onPlayerFullscreenExit(activeStreamIndex:int=-1, isAdSlotKey:Boolean = false):void; |
| | 415 | public function onPlayerPause(activeStreamIndex:int=-1, isAdSlotKey:Boolean = false):void; |
| | 416 | public function onPlayerResume(activeStreamIndex:int=-1, isAdSlotKey:Boolean = false):void; |
| | 417 | }}} |
| | 418 | |
| | 419 | ==== 4.9.1 Tracking Time |
| | 420 | |
| | 421 | The easiest way to inform OVA of the playback time for a linear ad clip is to use the `VASTController.processTimeEvent()` method. |
| | 422 | |
| | 423 | This method takes a stream index representing the index of the active ad clip within the OVA internal playlist (StreamSchedule) and a `TimeEvent`. |
| | 424 | |
| | 425 | A `TimeEvent` is a utility class that allows the time in milliseconds to be passed into `processTimeEvent()` along with the duration of the active clip. |
| | 426 | |
| | 427 | The following code snippet illustrates an example usage of `processTimeEvent()` method. In this case the active clip `position` reports the current playback time for the active clip. The `position` is reported in fractions of a second (e.g. 8.5 for 8.5 seconds) which needs to be converted to milliseconds as the `processTimeEvent()` method expects the time to be passed in milliseconds. |
| | 428 | |
| | 429 | {{{ |
| | 430 | _vastController.processTimeEvent(activeStreamIndex, new TimeEvent(_player.activeClip.position * 1000, _player.activeClip.duration)); |
| | 431 | }}} |
| | 432 | |
| | 433 | Normally a player implementation will call `processTimeEvent()` every 10th of a second - this is a fast enough cycle to ensure that all tracking events will correctly fire. |
| | 434 | |
| | 435 | ==== 4.9.2 Tracking time more efficiently |
| | 436 | |