Fix YouTube embeds and improve global chat auto-scroll

This commit is contained in:
Adolfo Reyna
2026-02-24 00:28:54 -05:00
parent d5850bb91e
commit 1f38b43d64
2 changed files with 104 additions and 5 deletions

View File

@@ -26,11 +26,10 @@ const videoIdF = (content) => {
// Extract YouTube video ID from content string
const youtubeIdF = (content) => {
let youtubeTag = content.match(/@youtube:[0-z]+/);
// Accept classic 11-char IDs and common ID-safe chars.
let youtubeTag = content.match(/@youtube:([A-Za-z0-9_-]+)/);
if (!youtubeTag) return '';
let tag = youtubeTag;
tag = tag[0].substring(1);
return tag.split(':')[1];
return youtubeTag[1];
};
// Extract HLS URL from content string
@@ -174,7 +173,13 @@ let Media = (props) => {
return (
<WebView
style={styles.iframe}
source={{ uri: "https://www.youtube.com/embed/" + youtubeId + "?fs=0" }}
source={{
uri: "https://www.youtube.com/embed/" + youtubeId + "?fs=0",
headers: {
Referer: "https://social.emmint.com",
"Referrer-Policy": "strict-origin-when-cross-origin",
},
}}
/>
);
}