@uncinc/uncinc-react-kitchen-sink 2.16.11 → 2.16.13
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.
|
@@ -12,7 +12,8 @@ import { COOKIE_CONSENT_CATEGORIES, COOKIE_CONSENT_STATE } from '../GoogleConsen
|
|
|
12
12
|
import { LocalConsentStatus } from '../GoogleConsentCookieBanner/types';
|
|
13
13
|
import './style.scss';
|
|
14
14
|
var CookieWrapper = function CookieWrapper(_ref) {
|
|
15
|
-
var children = _ref.children
|
|
15
|
+
var children = _ref.children,
|
|
16
|
+
url = _ref.url;
|
|
16
17
|
var _useTranslation = useTranslation(),
|
|
17
18
|
t = _useTranslation.t;
|
|
18
19
|
var _useCookieStore = useCookieStore(COOKIE_CONSENT_CATEGORIES),
|
|
@@ -44,12 +45,18 @@ var CookieWrapper = function CookieWrapper(_ref) {
|
|
|
44
45
|
}, t('cookie.wrapper.title', 'Cookies required')), /*#__PURE__*/React.createElement("p", {
|
|
45
46
|
className: "CookieWrapper__description"
|
|
46
47
|
}, t('cookie.wrapper.description', 'Analytics and Marketing cookies are required to display this content.')), /*#__PURE__*/React.createElement(Button, {
|
|
48
|
+
className: "CookieWrapper__edit",
|
|
47
49
|
primary: false,
|
|
48
|
-
inverted: true,
|
|
49
50
|
onClick: function onClick() {
|
|
50
51
|
return editCookies();
|
|
51
52
|
}
|
|
52
|
-
}, t('cookie.wrapper.button', 'Change cookiesettings'))
|
|
53
|
+
}, t('cookie.wrapper.button', 'Change cookiesettings')), url && /*#__PURE__*/React.createElement(Button, {
|
|
54
|
+
href: url,
|
|
55
|
+
className: "CookieWrapper__url",
|
|
56
|
+
primary: false,
|
|
57
|
+
target: "_blank",
|
|
58
|
+
rel: "noreferrer"
|
|
59
|
+
}, t('cookie.wrapper.url', 'Watch video in new tab')));
|
|
53
60
|
}
|
|
54
61
|
return children;
|
|
55
62
|
};
|
|
@@ -24,6 +24,8 @@ var MediaPlayer = function MediaPlayer(_ref) {
|
|
|
24
24
|
notSupportedMessage = _ref.notSupportedMessage,
|
|
25
25
|
className = _ref.className,
|
|
26
26
|
onPlay = _ref.onPlay,
|
|
27
|
+
_ref$autoPlay = _ref.autoPlay,
|
|
28
|
+
autoPlay = _ref$autoPlay === void 0 ? false : _ref$autoPlay,
|
|
27
29
|
onPause = _ref.onPause,
|
|
28
30
|
onEnded = _ref.onEnded,
|
|
29
31
|
onSeeking = _ref.onSeeking,
|
|
@@ -77,6 +79,7 @@ var MediaPlayer = function MediaPlayer(_ref) {
|
|
|
77
79
|
techOrder: ['html5', 'youtube', 'vimeo'],
|
|
78
80
|
poster: posterUrl,
|
|
79
81
|
controlBar: controlBar,
|
|
82
|
+
autoplay: autoPlay,
|
|
80
83
|
sources: [{
|
|
81
84
|
src: src,
|
|
82
85
|
type: type
|
|
@@ -92,10 +95,14 @@ var MediaPlayer = function MediaPlayer(_ref) {
|
|
|
92
95
|
// Passing down the VideoJS events.
|
|
93
96
|
useEffect(function () {
|
|
94
97
|
if (ready) {
|
|
95
|
-
if (onPlay) {
|
|
98
|
+
if (autoPlay && onPlay) {
|
|
96
99
|
player.one('play', function (event) {
|
|
97
100
|
return onPlay(player, event);
|
|
98
101
|
});
|
|
102
|
+
} else if (!autoPlay && onPlay) {
|
|
103
|
+
player.on('play', function (event) {
|
|
104
|
+
return onPlay(player, event);
|
|
105
|
+
});
|
|
99
106
|
}
|
|
100
107
|
if (onPause) {
|
|
101
108
|
player.one('pause', function (event) {
|
|
@@ -13,6 +13,7 @@ export type MediaPlayerProps = {
|
|
|
13
13
|
options?: VideoJsPlayerOptions;
|
|
14
14
|
captions?: VideoJsPlayerOptions['tracks'];
|
|
15
15
|
audioOnly?: boolean;
|
|
16
|
+
autoPlay?: boolean;
|
|
16
17
|
notSupportedMessage?: string;
|
|
17
18
|
className?: string;
|
|
18
19
|
onPlay?: (player: NativeVideoJsPlayer, event: EventTarget) => void;
|