Durée de l'extrait en cours de lecture à laquelle l'événement a été déclenché (en secondes). Cette valeur indique undefined si la lecture n'a pas encore commencé.
Sauf indication contraire, le contenu de cette page est régi par une licence Creative Commons Attribution 4.0, et les échantillons de code sont régis par une licence Apache 2.0. Pour en savoir plus, consultez les Règles du site Google Developers. Java est une marque déposée d'Oracle et/ou de ses sociétés affiliées.
Dernière mise à jour le 2025/07/25 (UTC).
[null,null,["Dernière mise à jour le 2025/07/25 (UTC)."],[[["\u003cp\u003e\u003ccode\u003eMediaElementEvent\u003c/code\u003e provides data for events originating from the \u003ccode\u003eMediaElement\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003eIt includes the event \u003ccode\u003etype\u003c/code\u003e and optionally the \u003ccode\u003ecurrentMediaTime\u003c/code\u003e of the media playback when the event occurred.\u003c/p\u003e\n"],["\u003cp\u003e\u003ccode\u003ecurrentMediaTime\u003c/code\u003e indicates the playback time in seconds and is undefined if playback hasn't begun.\u003c/p\u003e\n"]]],["The `MediaElementEvent` class handles events from the `MediaElement`. It's created using a constructor requiring a non-null `type` parameter, which corresponds to a `cast.framework.events.EventType`. An optional `currentMediaTime` parameter, representing the time in seconds of the current clip when the event occurred, is also available. The `currentMediaTime` property provides this time data; it's undefined if playback hasn't started.\n"],null,["# Class: MediaElementEvent\n\ncast.[framework](/cast/docs/reference/web_receiver/cast.framework).[events](/cast/docs/reference/web_receiver/cast.framework.events).MediaElementEvent\n======================================================================================================================================================\n\nclass static\n\nEvent data for all events forwarded from the `MediaElement`.\n\nConstructor\n-----------\n\n### MediaElementEvent\n\nnew\nMediaElementEvent(type, currentMediaTime)\n\n| #### Parameter ||\n|------------------|-------------------------------------------------------------------------------------------------------------------------------|\n| type | [cast.framework.events.EventType](/cast/docs/reference/web_receiver/cast.framework.events#.EventType) Value must not be null. |\n| currentMediaTime | Optional number |\n\nProperty\n--------\n\n### currentMediaTime\n\nconstant\n\n(number or undefined)\n\nThe time in the currently-playing clip when the event was fired (in\nseconds). This is `undefined` if playback has not started yet."]]