MCPcopy Index your code
hub / github.com/ampproject/amphtml / parseMessage

Function parseMessage

3p/viqeoplayer.js:73–90  ·  view source on GitHub ↗

* Parse events data for viqeo * @param {!Event|{data: !JsonObject}} event

(event)

Source from the content-addressed store, hash-verified

71 * @param {!Event|{data: !JsonObject}} event
72 */
73 function parseMessage(event) {
74 const eventData = getData(event);
75 const action = eventData['action'];
76 if (!action) {
77 return;
78 }
79 if (action === 'play') {
80 tryPlay(viqeoPlayerInstance);
81 } else if (action === 'pause') {
82 viqeoPlayerInstance.pause();
83 } else if (action === 'stop') {
84 viqeoPlayerInstance.stop();
85 } else if (action === 'mute') {
86 viqeoPlayerInstance.setVolume(0);
87 } else if (action === 'unmute') {
88 viqeoPlayerInstance.setVolume(1);
89 }
90 }
91}
92
93/**

Callers

nothing calls this directly

Calls 4

getDataFunction · 0.90
tryPlayFunction · 0.90
pauseMethod · 0.45
stopMethod · 0.45

Tested by

no test coverage detected