Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -463,9 +463,9 @@ class DraftJSMentionSelector extends React.Component<Props, State> {
};

getVideoTimestamp = (): videoTimestamp => {
const mediaDashContainer: ?HTMLElement = document.querySelector('.bp-media-dash');
const videoContainer: ?HTMLElement = document.querySelector('.bp-media-container');
// $FlowFixMe
const video: ?HTMLVideoElement = mediaDashContainer?.querySelector('video');
const video: ?HTMLVideoElement = videoContainer?.querySelector('video');

const currentTime = video?.currentTime || 0;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ export const VideoFile = () => {

return (
<div>
<div className="bp-media-dash" style={{ width: '100px', height: '100px', marginBottom: '10px' }}>
<div className="bp-media-container" style={{ width: '100px', height: '100px', marginBottom: '10px' }}>
{/* eslint-disable-next-line jsx-a11y/media-has-caption */}
<video
src="//cdn03.boxcdn.net/sites/default/files/homepage/v2/images/hero/run/laptop-screen-1680-v2@1x.mp4"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ describe('elements/content-sidebar/ActivityFeed/utils/formatTaggedMessage', () =
const mockMediaDashContainer = { querySelector: () => mockVideo };

jest.spyOn(document, 'querySelector').mockImplementation(query => {
if (query === '.bp-media-dash') {
if (query === '.bp-media-container') {
return mockMediaDashContainer;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ const formatTimestamp = (text: string, timestamp: string, intl: IntlShape): Reac

const handleClick = (e: SyntheticMouseEvent<HTMLButtonElement>): void => {
e.preventDefault();
const videoContainer = document.querySelector('.bp-media-dash');
const videoContainer = document.querySelector('.bp-media-container');
if (videoContainer) {
// $FlowFixMe: querySelector('video') returns an HTMLVideoElement
const video: ?HTMLVideoElement = videoContainer.querySelector('video');
Expand Down