Fix YouTube embeds and improve global chat auto-scroll
This commit is contained in:
@@ -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",
|
||||
},
|
||||
}}
|
||||
/>
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user