mirror of
https://github.com/duckietm/Nitro-V3.git
synced 2026-06-19 23:16:21 +00:00
🆕 Added the youtube player (not the furni)
This commit is contained in:
@@ -1,3 +1,6 @@
|
||||
import { GetConfigurationValue } from '../nitro/GetConfigurationValue';
|
||||
import { LocalizeText } from './LocalizeText';
|
||||
|
||||
const allowedColours: Map<string, string> = new Map();
|
||||
|
||||
allowedColours.set('r', 'red');
|
||||
@@ -44,6 +47,16 @@ export const RoomChatFormatter = (content: string) =>
|
||||
content = encodeHTML(content);
|
||||
//content = (joypixels.shortnameToUnicode(content) as string)
|
||||
|
||||
if(!GetConfigurationValue<boolean>('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,
|
||||
`<div style="margin:2px 0"><strong>📺 ${ labelShared }</strong></div><div><a href="https://youtu.be/$1" target="_blank" style="background-color:red;color:white;padding:3px 8px;border-radius:4px;text-decoration:none;font-size:12px">▶ ${ labelOpen }</a></div>`
|
||||
);
|
||||
}
|
||||
|
||||
if(content.startsWith('@') && content.indexOf('@', 1) > -1)
|
||||
{
|
||||
let match = null;
|
||||
|
||||
Reference in New Issue
Block a user