Skip to content

πŸŽ₯ Make videos programmatically with React

Update license-blacklist.tsx

Jonny Burger8d667a33acf9
diff --git a/packages/player/src/license-blacklist.tsx b/packages/player/src/license-blacklist.tsx
index 3c55ede64e..ed545c390a 100644
--- a/packages/player/src/license-blacklist.tsx
+++ b/packages/player/src/license-blacklist.tsx
@@ -1,4 +1,4 @@
-import React from 'react';
+import React, {useEffect} from 'react';
export const getHashOfDomain = async (): Promise<string | null> => {
if (typeof window === 'undefined') {
@@ -34,6 +34,48 @@ const style: React.CSSProperties = {
fontFamily: 'Arial',
};
+const DOMAIN_BLACKLIST = [
+ '28d262b44cc61fa750f1686b16ad0604dabfe193fbc263eec05c89b7ad4c2cd6',
+ '4db1b0a94be33165dfefcb3ba03d04c7a2666dd27c496d3dc9fa41858e94925e',
+ 'fbc48530bbf245da790f63675e84e06bab38c3b114fab07eb350025119922bdc',
+ '7baf10a8932757b1b3a22b3fce10a048747ac2f8eaf638603487e3705b07eb83',
+ '8a6c21a598d8c667272b5207c051b85997bf5b45d5fb712378be3f27cd72c6a6',
+ 'a2f7aaac9c50a9255e7fc376110c4e0bfe153722dc66ed3c5d3bf2a135f65518',
+];
+
+let ran = false;
+
export const RenderWarningIfBlacklist: React.FC = () => {
- return <div style={style}>Remotion Unlicensed – Contact [email protected]</div>;
+ const [unlicensed, setUnlicensed] = React.useState(false);
+
+ useEffect(() => {
+ // Prevent firing twice in strict mode
+ if (ran) {
+ return;
+ }
+
+ ran = true;
+ getHashOfDomain()
+ .then((hash) => {
+ if (hash && DOMAIN_BLACKLIST.includes(hash)) {
+ setUnlicensed(true);
+ }
+ })
+ .catch(() => {});
+ }, []);
+
+ if (!unlicensed) {
+ return null;
+ }
+
+ return (
+ <div style={style}>
+ <a
+ style={{color: 'white'}}
+ href="https://github.com/remotion-dev/remotion/pull/4589"
+ >
+ Remotion Unlicensed – Contact [email protected]
+ </a>
+ </div>
+ );
};