@openeventkit/event-site 2.0.61 → 2.0.63
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
|
@@ -34,10 +34,18 @@ export const setEventLastUpdate = (lastUpdate) => (dispatch) => {
|
|
|
34
34
|
*/
|
|
35
35
|
export const getEventById = (
|
|
36
36
|
eventId
|
|
37
|
-
) => async (dispatch) => {
|
|
37
|
+
) => async (dispatch, getState) => {
|
|
38
38
|
|
|
39
39
|
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
|
+
}
|
|
40
47
|
|
|
48
|
+
// then refresh from api
|
|
41
49
|
let accessToken;
|
|
42
50
|
try {
|
|
43
51
|
accessToken = await getAccessToken();
|
|
@@ -46,7 +46,7 @@ export const loadData = async (summitId, dataKey) => {
|
|
|
46
46
|
}
|
|
47
47
|
|
|
48
48
|
export const isSummitEventDataUpdate = (entity_type) => {
|
|
49
|
-
return entity_type === 'Presentation' || entity_type === 'SummitEvent';
|
|
49
|
+
return entity_type === 'Presentation' || entity_type === 'SummitEvent' || entity_type === 'SummitEventWithFile';
|
|
50
50
|
}
|
|
51
51
|
|
|
52
52
|
/**
|
package/src/utils/videoUtils.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
const IS_MUX_VIDEO_REGEX = /https:\/\/stream.mux.com\/(.*).m3u8/;
|
|
2
2
|
|
|
3
3
|
export const getMUXPlaybackId = (url) => {
|
|
4
|
+
if(!url) return null;
|
|
4
5
|
const fileMatch = url.match(IS_MUX_VIDEO_REGEX);
|
|
5
6
|
return fileMatch ? fileMatch[1] : null;
|
|
6
7
|
}
|
|
@@ -10,14 +11,17 @@ export const checkMuxTokens = (tokens) => {
|
|
|
10
11
|
}
|
|
11
12
|
|
|
12
13
|
export const isVimeoVideo = (url) => {
|
|
14
|
+
if(!url) return false;
|
|
13
15
|
// this is get from vimeo dash board
|
|
14
16
|
return url.match(/https:\/\/(www\.)?(player\.)?vimeo.com\/(.*)/);
|
|
15
17
|
};
|
|
16
18
|
|
|
17
19
|
export const isYouTubeVideo = (url) => {
|
|
20
|
+
if(!url) return false;
|
|
18
21
|
return url.match(/^(?:https?:\/\/)?(?:m\.|www\.)?(?:youtu\.be\/|youtube\.com\/(?:embed\/|v\/|watch\?v=|watch\?.+&v=))((\w|-){11})(?:\S+)?$/);
|
|
19
22
|
}
|
|
20
23
|
|
|
21
24
|
export const isMuxVideo = (url) => {
|
|
25
|
+
if(!url) return false;
|
|
22
26
|
return url.match(IS_MUX_VIDEO_REGEX)
|
|
23
27
|
}
|