-
-
+
+ { !state.active && (
+
+
+
+ )}
+ { state.active && state.display === 'small' && (
+
+ )}
+ { state.display !== 'small' && (
+
+
+
+ )}
-
{ updateState({ popout: false })}}>
-
-
)
}
diff --git a/net/web/src/session/conversation/topicItem/videoAsset/VideoAsset.styled.js b/net/web/src/session/conversation/topicItem/videoAsset/VideoAsset.styled.js
index eafb2c7d..fc6c3e34 100644
--- a/net/web/src/session/conversation/topicItem/videoAsset/VideoAsset.styled.js
+++ b/net/web/src/session/conversation/topicItem/videoAsset/VideoAsset.styled.js
@@ -4,46 +4,13 @@ export const VideoAssetWrapper = styled.div`
position: relative;
height: 100%;
- .playback {
- top: 0;
- position: absolute;
- display: flex;
- align-items: center;
- justify-content: center;
- }
-
- .player:hover .control {
- visibility: visible;
- }
-
- .player:hover .expand {
- visibility: visible;
- }
-
- .player {
+ .overlay {
position: absolute;
top: 0;
- }
-
- .control {
- top: 0;
- visibility: hidden;
- position: absolute;
- width: 100%;
- height: 100%;
- display: flex;
- align-items: center;
- justify-content: center;
- background-color: black;
- opacity: 0.5;
- }
-
- .expand {
- padding-left: 4px;
- visibility: hidden;
- position: absolute;
- bottom: 0;
left: 0;
+ display: flex;
+ align-items: center;
+ justify-content: center;
}
`;
diff --git a/net/web/src/session/conversation/topicItem/videoAsset/useVideoAsset.hook.js b/net/web/src/session/conversation/topicItem/videoAsset/useVideoAsset.hook.js
new file mode 100644
index 00000000..f00528df
--- /dev/null
+++ b/net/web/src/session/conversation/topicItem/videoAsset/useVideoAsset.hook.js
@@ -0,0 +1,35 @@
+import { useContext, useState, useEffect, useRef } from 'react';
+import { ViewportContext } from 'context/ViewportContext';
+
+export function useVideoAsset() {
+
+ const [state, setState] = useState({
+ display: null,
+ width: 0,
+ height: 0,
+ active: false,
+ });
+
+ const viewport = useContext(ViewportContext);
+
+ const updateState = (value) => {
+ setState((s) => ({ ...s, ...value }));
+ }
+
+ useEffect(() => {
+ updateState({ display: viewport.state.display });
+ }, []);
+
+ const actions = {
+ setActive: (width, height, url) => {
+console.log(width, height);
+ updateState({ active: true, width, height });
+ },
+ clearActive: () => {
+ updateState({ active: false });
+ },
+ };
+
+ return { state, actions };
+}
+