Page MenuHomePhabricator

D7993.diff
No OneTemporary

D7993.diff

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

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)

Event Timeline