diff --git a/src/api/utils/RoomChatFormatter.ts b/src/api/utils/RoomChatFormatter.ts index 6ca8964..1ce8a77 100644 --- a/src/api/utils/RoomChatFormatter.ts +++ b/src/api/utils/RoomChatFormatter.ts @@ -1,4 +1,3 @@ -import { GetConfigurationValue } from '../nitro/GetConfigurationValue'; import { LocalizeText } from './LocalizeText'; const allowedColours: Map = new Map(); @@ -47,16 +46,6 @@ export const RoomChatFormatter = (content: string) => content = encodeHTML(content); //content = (joypixels.shortnameToUnicode(content) as string) - if(!GetConfigurationValue('youtube.publish.disabled', false)) - { - const labelShared = LocalizeText('widget.room.youtube.shared'); - const labelOpen = LocalizeText('widget.room.youtube.open_video'); - content = content.replace( - /(?:http:\/\/|https:\/\/)?(?:www\.)?(?:youtube\.com|youtu\.be)\/(?:watch\?.*v=|shorts\/)?([a-zA-Z0-9_-]{11})/g, - `
📺 ${ labelShared }
▶ ${ labelOpen }
` - ); - } - if(content.startsWith('@') && content.indexOf('@', 1) > -1) { let match = null; diff --git a/src/components/MainView.tsx b/src/components/MainView.tsx index 799654f..f757aa7 100644 --- a/src/components/MainView.tsx +++ b/src/components/MainView.tsx @@ -31,7 +31,6 @@ import { UserProfileView } from './user-profile/UserProfileView'; import { UserSettingsView } from './user-settings/UserSettingsView'; import { WiredView } from './wired/WiredView'; import { WiredCreatorToolsView } from './wired-tools/WiredCreatorToolsView'; -import { YoutubeTvView } from './youtube-tv/YoutubeTvView'; export const MainView: FC<{}> = props => { @@ -124,7 +123,6 @@ export const MainView: FC<{}> = props => - ); diff --git a/src/components/youtube-tv/YoutubeTvView.tsx b/src/components/youtube-tv/YoutubeTvView.tsx deleted file mode 100644 index 166bcc3..0000000 --- a/src/components/youtube-tv/YoutubeTvView.tsx +++ /dev/null @@ -1,57 +0,0 @@ -import { AddLinkEventTracker, RemoveLinkEventTracker } from '@nitrots/nitro-renderer'; -import { FC, useEffect, useMemo, useState } from 'react'; -import { GetConfigurationValue } from '../../api'; -import { NitroCardContentView, NitroCardHeaderView, NitroCardView } from '../../common'; - -export const YoutubeTvView: FC<{}> = props => -{ - const [ videoId, setVideoId ] = useState(''); - const [ isVisible, setIsVisible ] = useState(false); - - const close = () => setIsVisible(false); - - useEffect(() => - { - const linkTracker: ILinkEventTracker = { - linkReceived: (url: string) => - { - const parts = url.split('/'); - - if(parts.length < 3) return; - - switch(parts[1]) - { - case 'show': - setVideoId(parts[2]); - setIsVisible(true); - return; - } - }, - eventUrlPrefix: 'youtube-tv/' - }; - - AddLinkEventTracker(linkTracker); - - return () => RemoveLinkEventTracker(linkTracker); - }, []); - - const originUrl = useMemo(() => GetConfigurationValue('url.prefix', ''), []); - - if(!isVisible) return null; - - return ( - - - - { (videoId.length > 0) && -