Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F3400798
D7993.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
2 KB
Referenced Files
None
Subscribers
None
D7993.diff
View Options
diff --git a/web/media/encrypted-multimedia.react.js b/web/media/encrypted-multimedia.react.js
--- a/web/media/encrypted-multimedia.react.js
+++ b/web/media/encrypted-multimedia.react.js
@@ -17,14 +17,21 @@
+holder: string,
+encryptionKey: string,
+type: EncryptedMediaType,
- +thumbnailHolder: ?string,
- +thumbnailEncryptionKey: ?string,
+ +thumbnailHolder?: ?string,
+ +thumbnailEncryptionKey?: ?string,
+placeholderSrc?: ?string,
+ +multimediaClassName?: string,
+elementStyle?: ?Shape<CSSStyleDeclaration>,
};
function EncryptedMultimedia(props: Props): React.Node {
- const { holder, encryptionKey, placeholderSrc, elementStyle } = props;
+ const {
+ holder,
+ encryptionKey,
+ placeholderSrc,
+ elementStyle,
+ multimediaClassName,
+ } = props;
const [source, setSource] = React.useState(null);
const videoRef = React.useRef(null);
@@ -91,6 +98,7 @@
<img
src={source?.uri ?? placeholderSrc}
key={holder}
+ className={multimediaClassName}
style={elementStyle}
/>
);
@@ -109,6 +117,7 @@
thumbnailSource={{ thumbnailHolder, thumbnailEncryptionKey }}
elementStyle={elementStyle}
thumbHashDataURL={placeholderSrc}
+ multimediaClassName={multimediaClassName}
/>
);
}
diff --git a/web/media/loadable-video.react.js b/web/media/loadable-video.react.js
--- a/web/media/loadable-video.react.js
+++ b/web/media/loadable-video.react.js
@@ -21,10 +21,17 @@
+thumbnailSource: ThumbnailSource,
+thumbHashDataURL?: ?string,
+elementStyle?: ?Shape<CSSStyleDeclaration>,
+ +multimediaClassName?: string,
};
function LoadableVideo(props: Props, videoRef: React.Ref<'video'>): React.Node {
- const { uri, thumbHashDataURL, thumbnailSource, elementStyle } = props;
+ const {
+ uri,
+ thumbHashDataURL,
+ thumbnailSource,
+ elementStyle,
+ multimediaClassName,
+ } = props;
const { thumbnailURI, thumbnailHolder, thumbnailEncryptionKey } =
thumbnailSource;
@@ -72,7 +79,13 @@
}
const poster = thumbnailImage ?? thumbHashDataURL;
return (
- <video controls poster={poster} style={elementStyle} ref={videoRef}>
+ <video
+ controls
+ poster={poster}
+ className={multimediaClassName}
+ style={elementStyle}
+ ref={videoRef}
+ >
{videoSource}
</video>
);
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Tue, Dec 3, 8:56 AM (18 h, 30 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2611094
Default Alt Text
D7993.diff (2 KB)
Attached To
Mode
D7993: [web] Add multimediaClassName prop to encrypted media components
Attached
Detach File
Event Timeline
Log In to Comment