1919
2020import { useCallback , useEffect , useState } from 'react' ;
2121
22- import { amplify } from 'amplify' ;
2322import cx from 'classnames' ;
2423import { container } from 'tsyringe' ;
2524
2625import { TabIndex , Button , ButtonVariant , useTimeout } from '@wireapp/react-ui-kit' ;
27- import { WebAppEvents } from '@wireapp/webapp-events' ;
2826
2927import { RestrictedVideo } from 'Components/asset/RestrictedVideo' ;
3028import { AssetError } from 'Repositories/assets/AssetError' ;
@@ -33,7 +31,6 @@ import {AssetTransferState} from 'Repositories/assets/AssetTransferState';
3331import type { ContentMessage } from 'Repositories/entity/message/ContentMessage' ;
3432import type { FileAsset as FileAssetType } from 'Repositories/entity/message/FileAsset' ;
3533import { TeamState } from 'Repositories/team/TeamState' ;
36- import { EventName } from 'Repositories/tracking/EventName' ;
3734import { useKoSubscribableChildren } from 'Util/ComponentUtil' ;
3835import { t } from 'Util/LocalizerUtil' ;
3936import { formatSeconds } from 'Util/TimeUtil' ;
@@ -94,10 +91,11 @@ const VideoAsset = ({
9491 const video = document . createElement ( 'video' ) ;
9592 const canPlay = video . canPlayType ( mimeType ) !== '' ;
9693
97- if ( ! canPlay ) {
98- amplify . publish ( WebAppEvents . ANALYTICS . EVENT , EventName . MESSAGES . VIDEO . PLAY_FAILED ) ;
99- amplify . publish ( WebAppEvents . ANALYTICS . EVENT , EventName . MESSAGES . VIDEO . UNSUPPORTED_MIME_TYPE ) ;
100- }
94+ // ToDo: This needs to be revisited
95+ // if (!canPlay) {
96+ // amplify.publish(WebAppEvents.ANALYTICS.EVENT, EventName.MESSAGES.VIDEO.PLAY_FAILED);
97+ // amplify.publish(WebAppEvents.ANALYTICS.EVENT, EventName.MESSAGES.VIDEO.UNSUPPORTED_MIME_TYPE);
98+ // }
10199
102100 return canPlay ;
103101 } ;
@@ -136,22 +134,25 @@ const VideoAsset = ({
136134 const playable = await isVideoPlayable ( assetUrl . url ) ;
137135
138136 if ( ! playable ) {
139- amplify . publish ( WebAppEvents . ANALYTICS . EVENT , EventName . MESSAGES . VIDEO . PLAY_FAILED ) ;
140- amplify . publish ( WebAppEvents . ANALYTICS . EVENT , EventName . MESSAGES . VIDEO . UNPLAYABLE_ERROR ) ;
137+ // ToDo: This needs to be revisited
138+ // amplify.publish(WebAppEvents.ANALYTICS.EVENT, EventName.MESSAGES.VIDEO.PLAY_FAILED);
139+ // amplify.publish(WebAppEvents.ANALYTICS.EVENT, EventName.MESSAGES.VIDEO.UNPLAYABLE_ERROR);
141140 setVideoPlaybackError ( true ) ;
142141 return ;
143142 }
144143
145144 setVideoSrc ( assetUrl ) ;
146145 setIsVideoLoaded ( true ) ;
147- amplify . publish ( WebAppEvents . ANALYTICS . EVENT , EventName . MESSAGES . VIDEO . PLAY_SUCCESS ) ;
146+ // ToDo: This needs to be revisited
147+ //amplify.publish(WebAppEvents.ANALYTICS.EVENT, EventName.MESSAGES.VIDEO.PLAY_SUCCESS);
148148 } catch ( error ) {
149149 if ( error instanceof Error ) {
150150 if ( error . name !== AssetError . CANCEL_ERROR ) {
151151 setVideoPlaybackError ( true ) ;
152152 }
153153 }
154- amplify . publish ( WebAppEvents . ANALYTICS . EVENT , EventName . MESSAGES . VIDEO . PLAY_FAILED ) ;
154+ // ToDo: This needs to be revisited
155+ //amplify.publish(WebAppEvents.ANALYTICS.EVENT, EventName.MESSAGES.VIDEO.PLAY_FAILED);
155156 console . error ( 'Failed to load video asset ' , error ) ;
156157 }
157158
@@ -216,7 +217,8 @@ const VideoAsset = ({
216217 poster = { videoPreview ?. url }
217218 onError = { event => {
218219 setVideoPlaybackError ( true ) ;
219- amplify . publish ( WebAppEvents . ANALYTICS . EVENT , EventName . MESSAGES . VIDEO . PLAY_FAILED ) ;
220+ // ToDo: This needs to be revisited
221+ //amplify.publish(WebAppEvents.ANALYTICS.EVENT, EventName.MESSAGES.VIDEO.PLAY_FAILED);
220222 console . error ( 'Video cannot be played' , event ) ;
221223 } }
222224 onPlaying = { onVideoPlaying }
0 commit comments