diff --git a/src/script/components/MessagesList/Message/ContentMessage/asset/MultipartAssets/VideoAssetCard/VideoAssetPlayer/useVideoPlayback/useVideoPlayback.ts b/src/script/components/MessagesList/Message/ContentMessage/asset/MultipartAssets/VideoAssetCard/VideoAssetPlayer/useVideoPlayback/useVideoPlayback.ts index cff2581f3d1..92246b7d3d8 100644 --- a/src/script/components/MessagesList/Message/ContentMessage/asset/MultipartAssets/VideoAssetCard/VideoAssetPlayer/useVideoPlayback/useVideoPlayback.ts +++ b/src/script/components/MessagesList/Message/ContentMessage/asset/MultipartAssets/VideoAssetCard/VideoAssetPlayer/useVideoPlayback/useVideoPlayback.ts @@ -19,12 +19,6 @@ import {useState, useCallback, useRef, SyntheticEvent} from 'react'; -import {amplify} from 'amplify'; - -import {WebAppEvents} from '@wireapp/webapp-events'; - -import {EventName} from 'Repositories/tracking/EventName'; - import {isVideoPlayable} from './isVideoPlayable/isVideoPlayable'; interface UseVideoPlaybackProps { @@ -59,8 +53,9 @@ export const useVideoPlayback = ({url, videoElement, isEnabled}: UseVideoPlaybac if (!playable) { const status = 'unplayable'; - amplify.publish(WebAppEvents.ANALYTICS.EVENT, EventName.MESSAGES.VIDEO.PLAY_FAILED); - amplify.publish(WebAppEvents.ANALYTICS.EVENT, EventName.MESSAGES.VIDEO.UNPLAYABLE_ERROR); + // Todo: This needs to be revisited + // amplify.publish(WebAppEvents.ANALYTICS.EVENT, EventName.MESSAGES.VIDEO.PLAY_FAILED); + // amplify.publish(WebAppEvents.ANALYTICS.EVENT, EventName.MESSAGES.VIDEO.UNPLAYABLE_ERROR); setIsError(true); playabilityStatusRef.current = status; return status; @@ -108,7 +103,8 @@ export const useVideoPlayback = ({url, videoElement, isEnabled}: UseVideoPlaybac const handleError = useCallback((event: SyntheticEvent) => { setIsError(true); - amplify.publish(WebAppEvents.ANALYTICS.EVENT, EventName.MESSAGES.VIDEO.PLAY_FAILED); + // Todo: This needs to be revisited + //amplify.publish(WebAppEvents.ANALYTICS.EVENT, EventName.MESSAGES.VIDEO.PLAY_FAILED); console.error('Video cannot be played', event); }, []); diff --git a/src/script/components/MessagesList/Message/ContentMessage/asset/VideoAsset/VideoAsset.tsx b/src/script/components/MessagesList/Message/ContentMessage/asset/VideoAsset/VideoAsset.tsx index f79475821fa..efbee752921 100644 --- a/src/script/components/MessagesList/Message/ContentMessage/asset/VideoAsset/VideoAsset.tsx +++ b/src/script/components/MessagesList/Message/ContentMessage/asset/VideoAsset/VideoAsset.tsx @@ -19,12 +19,10 @@ import {useCallback, useEffect, useState} from 'react'; -import {amplify} from 'amplify'; import cx from 'classnames'; import {container} from 'tsyringe'; import {TabIndex, Button, ButtonVariant, useTimeout} from '@wireapp/react-ui-kit'; -import {WebAppEvents} from '@wireapp/webapp-events'; import {RestrictedVideo} from 'Components/asset/RestrictedVideo'; import {AssetError} from 'Repositories/assets/AssetError'; @@ -33,7 +31,6 @@ import {AssetTransferState} from 'Repositories/assets/AssetTransferState'; import type {ContentMessage} from 'Repositories/entity/message/ContentMessage'; import type {FileAsset as FileAssetType} from 'Repositories/entity/message/FileAsset'; import {TeamState} from 'Repositories/team/TeamState'; -import {EventName} from 'Repositories/tracking/EventName'; import {useKoSubscribableChildren} from 'Util/ComponentUtil'; import {t} from 'Util/LocalizerUtil'; import {formatSeconds} from 'Util/TimeUtil'; @@ -94,10 +91,11 @@ const VideoAsset = ({ const video = document.createElement('video'); const canPlay = video.canPlayType(mimeType) !== ''; - if (!canPlay) { - amplify.publish(WebAppEvents.ANALYTICS.EVENT, EventName.MESSAGES.VIDEO.PLAY_FAILED); - amplify.publish(WebAppEvents.ANALYTICS.EVENT, EventName.MESSAGES.VIDEO.UNSUPPORTED_MIME_TYPE); - } + // ToDo: This needs to be revisited + // if (!canPlay) { + // amplify.publish(WebAppEvents.ANALYTICS.EVENT, EventName.MESSAGES.VIDEO.PLAY_FAILED); + // amplify.publish(WebAppEvents.ANALYTICS.EVENT, EventName.MESSAGES.VIDEO.UNSUPPORTED_MIME_TYPE); + // } return canPlay; }; @@ -136,22 +134,25 @@ const VideoAsset = ({ const playable = await isVideoPlayable(assetUrl.url); if (!playable) { - amplify.publish(WebAppEvents.ANALYTICS.EVENT, EventName.MESSAGES.VIDEO.PLAY_FAILED); - amplify.publish(WebAppEvents.ANALYTICS.EVENT, EventName.MESSAGES.VIDEO.UNPLAYABLE_ERROR); + // ToDo: This needs to be revisited + // amplify.publish(WebAppEvents.ANALYTICS.EVENT, EventName.MESSAGES.VIDEO.PLAY_FAILED); + // amplify.publish(WebAppEvents.ANALYTICS.EVENT, EventName.MESSAGES.VIDEO.UNPLAYABLE_ERROR); setVideoPlaybackError(true); return; } setVideoSrc(assetUrl); setIsVideoLoaded(true); - amplify.publish(WebAppEvents.ANALYTICS.EVENT, EventName.MESSAGES.VIDEO.PLAY_SUCCESS); + // ToDo: This needs to be revisited + //amplify.publish(WebAppEvents.ANALYTICS.EVENT, EventName.MESSAGES.VIDEO.PLAY_SUCCESS); } catch (error) { if (error instanceof Error) { if (error.name !== AssetError.CANCEL_ERROR) { setVideoPlaybackError(true); } } - amplify.publish(WebAppEvents.ANALYTICS.EVENT, EventName.MESSAGES.VIDEO.PLAY_FAILED); + // ToDo: This needs to be revisited + //amplify.publish(WebAppEvents.ANALYTICS.EVENT, EventName.MESSAGES.VIDEO.PLAY_FAILED); console.error('Failed to load video asset ', error); } @@ -216,7 +217,8 @@ const VideoAsset = ({ poster={videoPreview?.url} onError={event => { setVideoPlaybackError(true); - amplify.publish(WebAppEvents.ANALYTICS.EVENT, EventName.MESSAGES.VIDEO.PLAY_FAILED); + // ToDo: This needs to be revisited + //amplify.publish(WebAppEvents.ANALYTICS.EVENT, EventName.MESSAGES.VIDEO.PLAY_FAILED); console.error('Video cannot be played', event); }} onPlaying={onVideoPlaying}