@openeventkit/event-site 2.0.124-beta.5 → 2.0.124

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@openeventkit/event-site",
3
3
  "description": "Event Site",
4
- "version": "2.0.124-beta.5",
4
+ "version": "2.0.124",
5
5
  "author": "Tipit LLC",
6
6
  "dependencies": {
7
7
  "@fortawesome/fontawesome-svg-core": "^6.5.2",
@@ -28,7 +28,7 @@
28
28
  "@vimeo/player": "^2.16.3",
29
29
  "ably": "^1.2.34",
30
30
  "assert": "^2.1.0",
31
- "attendee-to-attendee-widget": "3.1.1-beta.31",
31
+ "attendee-to-attendee-widget": "3.1.1-beta.32",
32
32
  "autoprefixer": "10.4.14",
33
33
  "awesome-bootstrap-checkbox": "^1.0.1",
34
34
  "axios": "^0.19.2",
@@ -29,23 +29,14 @@ export const setEventLastUpdate = (lastUpdate) => (dispatch) => {
29
29
 
30
30
  /**
31
31
  * @param eventId
32
- * @param checkLocal
33
32
  * @returns {(function(*, *): Promise<*>)|*}
34
33
  */
35
34
  export const getEventById = (
36
35
  eventId
37
- ) => async (dispatch, getState) => {
36
+ ) => async (dispatch) => {
38
37
 
39
38
  dispatch(startLoading());
40
- // if we have it on the reducer , provide that first
41
- let {allSchedulesState: {allEvents}} = getState();
42
- const event = allEvents.find(ev => ev.id === parseInt(eventId));
43
-
44
- if (event) {
45
- dispatch(createAction(GET_EVENT_DATA)({event}));
46
- }
47
39
 
48
- // then refresh from api
49
40
  let accessToken;
50
41
  try {
51
42
  accessToken = await getAccessToken();
@@ -0,0 +1,58 @@
1
+ import React from 'react';
2
+ import PropTypes from 'prop-types';
3
+ import {getSynchWordsVideoFrameDdFromSrc} from "../utils/videoUtils";
4
+
5
+
6
+ class SynchWordsPlayer extends React.Component {
7
+
8
+ constructor(props) {
9
+ super(props);
10
+ }
11
+
12
+ componentDidMount() {
13
+ }
14
+
15
+ componentWillUnmount() {
16
+ }
17
+
18
+ render() {
19
+ const { video, className, autoplay } = this.props;
20
+ const id = getSynchWordsVideoFrameDdFromSrc(video);
21
+ console.log(`SynchWordsPlayer::render with id ${id}`);
22
+ let allow = "encrypted-media";
23
+ if(autoplay) allow = allow +';autoplay'
24
+ return (
25
+ <div className={className}>
26
+ <iframe id={id}
27
+ src={video}
28
+ frameBorder="0"
29
+ scrolling="no"
30
+ allow={allow}
31
+ allowFullScreen webkitallowfullscreen mozallowfullscreen oallowfullscreen msallowfullscreen
32
+ >
33
+ </iframe>
34
+ </div>
35
+ );
36
+ }
37
+ }
38
+
39
+ SynchWordsPlayer.propTypes = {
40
+ /**
41
+ * a video URL.
42
+ */
43
+ video: PropTypes.oneOfType([
44
+ PropTypes.number,
45
+ PropTypes.string,
46
+ ]),
47
+ /**
48
+ * CSS className for the player element.
49
+ */
50
+ className: PropTypes.string,
51
+ /**
52
+ * Automatically start playback of the video. Note that this won’t work on
53
+ * some devices.
54
+ */
55
+ autoplay: PropTypes.bool,
56
+ };
57
+
58
+ export default SynchWordsPlayer;
@@ -4,7 +4,8 @@ import VideoJSPlayer from './VideoJSPlayer';
4
4
  import VimeoPlayer from "./VimeoPlayer";
5
5
  import VideoMUXPlayer from './VideoMUXPlayer';
6
6
  import styles from '../styles/video.module.scss';
7
- import { isMuxVideo, isVimeoVideo, isYouTubeVideo } from '../utils/videoUtils';
7
+ import { isMuxVideo, isVimeoVideo, isYouTubeVideo, isSynchWordsVideo } from '../utils/videoUtils';
8
+ import SynchWordsPlayer from "./SyncWordsPlayer";
8
9
 
9
10
  /**
10
11
  * @param url
@@ -48,6 +49,14 @@ const VideoComponent = ({ url, title, namespace, isLive, firstHalf, autoPlay, st
48
49
  />
49
50
  );
50
51
  };
52
+ // synch words player
53
+ if(isSynchWordsVideo(url)){
54
+ return (<SynchWordsPlayer
55
+ video={url}
56
+ autoplay={autoPlay}
57
+ className={styles.synchWordsPlayer}
58
+ />);
59
+ }
51
60
 
52
61
  const defaultVideoJsOptions = isYouTubeVideo(url) ? {
53
62
  techOrder: ["youtube"],
@@ -99,7 +108,7 @@ VideoComponent.propTypes = {
99
108
  isLive: PropTypes.bool,
100
109
  firstHalf: PropTypes.bool,
101
110
  autoPlay: PropTypes.bool,
102
- start: PropTypes.number,
111
+ start: PropTypes.number,
103
112
  tokens: PropTypes.object,
104
113
  onError: PropTypes.func,
105
114
  };
@@ -108,7 +117,7 @@ VideoComponent.defaultProps = {
108
117
  title: '',
109
118
  namespace: '',
110
119
  firstHalf: true,
111
- autoPlay: false,
120
+ autoPlay: false,
112
121
  tokens: null,
113
122
  };
114
123
 
@@ -319,6 +319,11 @@ export const TicketPopupEditDetailsForm = ({
319
319
  onBlur={formik.handleBlur}
320
320
  onChange={!!initialValues[TicketKeys.company].name ? noop : formik.handleChange}
321
321
  disabled={!!initialValues[TicketKeys.company].name}
322
+ menuPortalTarget={document.body}
323
+ menuPosition="fixed"
324
+ styles={{
325
+ menuPortal: (base) => ({ ...base, zIndex: 9999 }),
326
+ }}
322
327
  tabSelectsValue={false}
323
328
  />
324
329
  {(formik.touched[TicketKeys.company] || triedSubmitting) && formik.errors[TicketKeys.company] &&
@@ -16,4 +16,24 @@
16
16
  width: 100%;
17
17
  height: 100%;
18
18
  }
19
- }
19
+ }
20
+
21
+ .synchWordsPlayer{
22
+ /* 16:9 */
23
+ --video--width: 960;
24
+ --video--height: 540;
25
+
26
+ position: relative;
27
+ padding-bottom: calc(var(--video--height) / var(--video--width) * 100%); /* 56.25% */
28
+ overflow: hidden;
29
+ max-width: 100%;
30
+ background: black;
31
+
32
+ iframe, object, embed{
33
+ position: absolute;
34
+ top: 0;
35
+ left: 0;
36
+ width: 100%;
37
+ height: 100%;
38
+ }
39
+ }
@@ -1,4 +1,5 @@
1
1
  const IS_MUX_VIDEO_REGEX = /https:\/\/stream.mux.com\/(.*).m3u8/;
2
+ const IS_SYNC_WORDS_VIDEO_REGEX = /https:\/\/iframe\.dacast\.com\/live\/(.*)\/(.*)/g;
2
3
 
3
4
  export const getMUXPlaybackId = (url) => {
4
5
  if(!url) return null;
@@ -25,3 +26,20 @@ export const isMuxVideo = (url) => {
25
26
  if(!url) return false;
26
27
  return url.match(IS_MUX_VIDEO_REGEX)
27
28
  }
29
+
30
+ export const isSynchWordsVideo = (url) => {
31
+ if(!url) return false;
32
+ return url.match(IS_SYNC_WORDS_VIDEO_REGEX);
33
+ }
34
+
35
+ /**
36
+ * @param src
37
+ * @returns {string|null}
38
+ */
39
+ export const getSynchWordsVideoFrameDdFromSrc = (src) => {
40
+ const m = [...src.matchAll(IS_SYNC_WORDS_VIDEO_REGEX)];
41
+ if(!m?.length) return null;
42
+ const parts = m[0];
43
+ if(parts.length < 3) return null;
44
+ return `${parts[1]}-live-${parts[2]}`;
45
+ }