hr-design-system-handlebars 0.55.3 → 0.56.0

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.
Files changed (107) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/dist/assets/index.css +30 -37
  3. package/dist/assets/js/views/components/mediaplayer/ardPlayerLoader.subfeature.js +132 -0
  4. package/dist/assets/js/views/components/mediaplayer/mediaplayerLoader.feature.js +32 -0
  5. package/dist/views/components/mediaplayer/ardPlayerLoader.subfeature.js +132 -0
  6. package/dist/views/components/mediaplayer/media_player.hbs +30 -0
  7. package/dist/views/components/mediaplayer/mediaplayerLoader.feature.js +32 -0
  8. package/dist/views/components/teaser/components/teaser_av_consumption.hbs +8 -4
  9. package/package.json +1 -1
  10. package/src/assets/fixtures/audio/audios.inc.json +127 -0
  11. package/src/assets/fixtures/teaser/teaser_lead.inc.json +68 -102
  12. package/src/assets/fixtures/teaser/teaser_standard_25_serif_audio_livestream.json +36 -0
  13. package/src/assets/fixtures/teaser/teaser_standard_50_serif_audio_livestream.json +21 -0
  14. package/src/assets/fixtures/teaser/teasers.inc.json +1 -0
  15. package/src/assets/fixtures/video/videos.inc.json +143 -0
  16. package/src/assets/vendor/ardplayer/ardplayer-hr-6.3.4.4fc164e9.css +7497 -0
  17. package/src/assets/vendor/ardplayer/ardplayer-hr-6.3.4.8ea4ea3d.js +6322 -0
  18. package/src/assets/vendor/ardplayer/ardplayer-libimsc.179db74a.chunk.js +444 -0
  19. package/src/assets/vendor/ardplayer/ardplayer-pluginhtmlv.4f6a1291.chunk.js +27 -0
  20. package/src/assets/vendor/ardplayer/ardplayer-vendors~pluginchromecast.1fb1b290.chunk.js +27 -0
  21. package/src/assets/vendor/ardplayer/ardplayer-vendors~pluginchromecast~plugindash~pluginhls~pluginhtmla~pluginhtmlv.a52f1cc9.chunk.js +27 -0
  22. package/src/assets/vendor/ardplayer/ardplayer-vendors~plugindash.446f5c07.chunk.js +38 -0
  23. package/src/assets/vendor/ardplayer/ardplayer-vendors~pluginhls.ab9656f5.chunk.js +38 -0
  24. package/src/assets/vendor/ardplayer/ardplayer-vendors~pluginhtmla.aadd9d24.chunk.js +27 -0
  25. package/src/assets/vendor/ardplayer/ardplayer-vendors~pluginhtmla~pluginhtmlv.08e5de97.chunk.js +15 -0
  26. package/src/stories/views/components/mediaplayer/ardPlayerLoader.subfeature.js +132 -0
  27. package/src/stories/views/components/mediaplayer/media_player.hbs +30 -0
  28. package/src/stories/views/components/mediaplayer/mediaplayerLoader.feature.js +32 -0
  29. package/src/stories/views/components/teaser/components/teaser_av_consumption.hbs +8 -4
  30. package/src/stories/views/components/teaser/fixtures/cluster_teaser_100.json +1 -1
  31. package/src/stories/views/components/teaser/fixtures/cluster_teaser_100_genre.json +1 -1
  32. package/src/stories/views/components/teaser/fixtures/cluster_teaser_33.json +1 -1
  33. package/src/stories/views/components/teaser/fixtures/cluster_teaser_33_genre.json +1 -1
  34. package/src/stories/views/components/teaser/fixtures/cluster_teaser_50.json +1 -1
  35. package/src/stories/views/components/teaser/fixtures/cluster_teaser_50_genre.json +1 -1
  36. package/src/stories/views/components/teaser/fixtures/cluster_teaser_extern_100.json +1 -1
  37. package/src/stories/views/components/teaser/fixtures/cluster_teaser_extern_33.json +1 -1
  38. package/src/stories/views/components/teaser/fixtures/cluster_teaser_extern_50.json +1 -1
  39. package/src/stories/views/components/teaser/fixtures/cluster_teaser_ordered_100.json +1 -1
  40. package/src/stories/views/components/teaser/fixtures/cluster_teaser_ordered_33.json +1 -1
  41. package/src/stories/views/components/teaser/fixtures/cluster_teaser_ordered_50.json +1 -1
  42. package/src/stories/views/components/teaser/fixtures/teaser_alternative_100_serif.json +1 -1
  43. package/src/stories/views/components/teaser/fixtures/teaser_alternative_100_serif_audio.json +1 -1
  44. package/src/stories/views/components/teaser/fixtures/teaser_alternative_100_serif_live.json +1 -1
  45. package/src/stories/views/components/teaser/fixtures/teaser_alternative_100_serif_video.json +1 -1
  46. package/src/stories/views/components/teaser/fixtures/teaser_alternative_50_serif.json +1 -1
  47. package/src/stories/views/components/teaser/fixtures/teaser_alternative_50_serif_audio.json +1 -1
  48. package/src/stories/views/components/teaser/fixtures/teaser_alternative_50_serif_live.json +1 -1
  49. package/src/stories/views/components/teaser/fixtures/teaser_alternative_50_serif_video.json +1 -1
  50. package/src/stories/views/components/teaser/fixtures/teaser_alternative_hero_serif.json +1 -1
  51. package/src/stories/views/components/teaser/fixtures/teaser_alternative_hero_serif_audio.json +1 -1
  52. package/src/stories/views/components/teaser/fixtures/teaser_alternative_hero_serif_label.json +1 -1
  53. package/src/stories/views/components/teaser/fixtures/teaser_alternative_hero_serif_live.json +1 -1
  54. package/src/stories/views/components/teaser/fixtures/teaser_alternative_hero_serif_video.json +1 -1
  55. package/src/stories/views/components/teaser/fixtures/teaser_cluster.json +1 -1
  56. package/src/stories/views/components/teaser/fixtures/teaser_group_100.json +1 -1
  57. package/src/stories/views/components/teaser/fixtures/teaser_group_100_highlight.json +1 -1
  58. package/src/stories/views/components/teaser/fixtures/teaser_group_100_highlight_2.json +1 -1
  59. package/src/stories/views/components/teaser/fixtures/teaser_index.json +1 -1
  60. package/src/stories/views/components/teaser/fixtures/teaser_poster_lg.json +1 -1
  61. package/src/stories/views/components/teaser/fixtures/teaser_poster_md.json +1 -1
  62. package/src/stories/views/components/teaser/fixtures/teaser_poster_md_label.json +1 -1
  63. package/src/stories/views/components/teaser/fixtures/teaser_standard_100_serif.json +1 -1
  64. package/src/stories/views/components/teaser/fixtures/teaser_standard_25_serif.json +1 -1
  65. package/src/stories/views/components/teaser/fixtures/teaser_standard_25_serif_audio.json +1 -1
  66. package/src/stories/views/components/teaser/fixtures/teaser_standard_25_serif_audio_livestream.json +1 -0
  67. package/src/stories/views/components/teaser/fixtures/teaser_standard_25_serif_live.json +1 -1
  68. package/src/stories/views/components/teaser/fixtures/teaser_standard_25_serif_video.json +1 -1
  69. package/src/stories/views/components/teaser/fixtures/teaser_standard_33_serif.json +1 -1
  70. package/src/stories/views/components/teaser/fixtures/teaser_standard_33_serif_tabbox.json +1 -1
  71. package/src/stories/views/components/teaser/fixtures/teaser_standard_50_serif.json +1 -1
  72. package/src/stories/views/components/teaser/fixtures/teaser_standard_50_serif_audio.json +1 -1
  73. package/src/stories/views/components/teaser/fixtures/teaser_standard_50_serif_audio_livestream.json +1 -0
  74. package/src/stories/views/components/teaser/fixtures/teaser_standard_50_serif_live.json +1 -1
  75. package/src/stories/views/components/teaser/fixtures/teaser_standard_50_serif_tabbox.json +1 -1
  76. package/src/stories/views/components/teaser/fixtures/teaser_standard_50_serif_video.json +1 -1
  77. package/src/stories/views/components/teaser/fixtures/teaser_standard_hero_serif.json +1 -1
  78. package/src/stories/views/components/teaser/fixtures/teaser_standard_hero_serif_label.json +1 -1
  79. package/src/stories/views/components/teaser/fixtures/teaser_tabbox.json +1 -1
  80. package/src/stories/views/components/teaser/teaser_standard_av.stories.mdx +17 -3
  81. package/dist/assets/js/views/components/audio/audioElementDs.subfeature.js +0 -127
  82. package/dist/assets/js/views/components/mediaplayer/mediaplayerLoaderDs.feature.js +0 -98
  83. package/dist/assets/js/views/components/video/livestream/videoLivestreamDs.subfeature.js +0 -263
  84. package/dist/assets/js/views/components/video/videoOnDemandPlayerDs.subfeature.js +0 -369
  85. package/dist/views/components/audio/audioElementDs.subfeature.js +0 -127
  86. package/dist/views/components/audio/audio_element.hbs +0 -72
  87. package/dist/views/components/mediaplayer/mediaplayerLoaderDs.feature.js +0 -98
  88. package/dist/views/components/video/livestream/videoLivestreamDs.subfeature.js +0 -263
  89. package/dist/views/components/video/livestream/video_livestream.hbs +0 -69
  90. package/dist/views/components/video/videoOnDemandPlayerDs.subfeature.js +0 -369
  91. package/dist/views/components/video/video_element.hbs +0 -81
  92. package/src/assets/vendor/ardplayer/ardplayer-hr-6.3.4.055f7511.css +0 -3
  93. package/src/assets/vendor/ardplayer/ardplayer-hr-6.3.4.d39f03b6.js +0 -6
  94. package/src/assets/vendor/ardplayer/ardplayer-libimsc.9e067311.chunk.js +0 -13
  95. package/src/assets/vendor/ardplayer/ardplayer-pluginchromecast.8ad4db4d.chunk.js +0 -1
  96. package/src/assets/vendor/ardplayer/ardplayer-pluginhtmla.77bf082c.chunk.js +0 -1
  97. package/src/assets/vendor/ardplayer/ardplayer-pluginhtmlv.8be44713.chunk.js +0 -1
  98. package/src/assets/vendor/ardplayer/ardplayer-vendors~pluginchromecast~plugindash~pluginhls~pluginhtmla~pluginhtmlv.9fbaccf5.chunk.js +0 -1
  99. package/src/assets/vendor/ardplayer/ardplayer-vendors~plugindash.32239ff8.chunk.js +0 -1066
  100. package/src/assets/vendor/ardplayer/ardplayer-vendors~pluginhls.f21f56cc.chunk.js +0 -365
  101. package/src/stories/views/components/audio/audioElementDs.subfeature.js +0 -127
  102. package/src/stories/views/components/audio/audio_element.hbs +0 -72
  103. package/src/stories/views/components/mediaplayer/mediaplayerLoaderDs.feature.js +0 -98
  104. package/src/stories/views/components/video/livestream/videoLivestreamDs.subfeature.js +0 -263
  105. package/src/stories/views/components/video/livestream/video_livestream.hbs +0 -69
  106. package/src/stories/views/components/video/videoOnDemandPlayerDs.subfeature.js +0 -369
  107. package/src/stories/views/components/video/video_element.hbs +0 -81
package/CHANGELOG.md CHANGED
@@ -1,3 +1,15 @@
1
+ # v0.56.0 (Tue Aug 30 2022)
2
+
3
+ #### 🚀 Enhancement
4
+
5
+ - Feature/dpe 1567 [#305](https://github.com/mumprod/hr-design-system-handlebars/pull/305) ([@szuelch](https://github.com/szuelch))
6
+
7
+ #### Authors: 1
8
+
9
+ - [@szuelch](https://github.com/szuelch)
10
+
11
+ ---
12
+
1
13
  # v0.55.3 (Fri Aug 19 2022)
2
14
 
3
15
  #### 🐛 Bug Fix
@@ -683,14 +683,6 @@ video {
683
683
  .m-1 {
684
684
  margin: 0.25rem;
685
685
  }
686
- .my-5 {
687
- margin-top: 1.25rem;
688
- margin-bottom: 1.25rem;
689
- }
690
- .mx-5 {
691
- margin-left: 1.25rem;
692
- margin-right: 1.25rem;
693
- }
694
686
  .my-2 {
695
687
  margin-top: 0.5rem;
696
688
  margin-bottom: 0.5rem;
@@ -699,6 +691,14 @@ video {
699
691
  margin-left: 1rem;
700
692
  margin-right: 1rem;
701
693
  }
694
+ .my-5 {
695
+ margin-top: 1.25rem;
696
+ margin-bottom: 1.25rem;
697
+ }
698
+ .mx-5 {
699
+ margin-left: 1.25rem;
700
+ margin-right: 1.25rem;
701
+ }
702
702
  .mx-8 {
703
703
  margin-left: 2rem;
704
704
  margin-right: 2rem;
@@ -822,9 +822,6 @@ video {
822
822
  .aspect-video {
823
823
  aspect-ratio: 16 / 9;
824
824
  }
825
- .h-12 {
826
- height: 3rem;
827
- }
828
825
  .h-10 {
829
826
  height: 2.5rem;
830
827
  }
@@ -837,6 +834,9 @@ video {
837
834
  .h-full {
838
835
  height: 100%;
839
836
  }
837
+ .h-auto {
838
+ height: auto;
839
+ }
840
840
  .h-0\.5 {
841
841
  height: 0.125rem;
842
842
  }
@@ -858,9 +858,6 @@ video {
858
858
  .h-2\/5 {
859
859
  height: 40%;
860
860
  }
861
- .h-auto {
862
- height: auto;
863
- }
864
861
  .h-3\.5 {
865
862
  height: 0.875rem;
866
863
  }
@@ -882,15 +879,12 @@ video {
882
879
  .w-16 {
883
880
  width: 4rem;
884
881
  }
885
- .w-12 {
886
- width: 3rem;
882
+ .w-10 {
883
+ width: 2.5rem;
887
884
  }
888
885
  .w-full {
889
886
  width: 100%;
890
887
  }
891
- .w-10 {
892
- width: 2.5rem;
893
- }
894
888
  .\!w-full {
895
889
  width: 100% !important;
896
890
  }
@@ -917,6 +911,9 @@ video {
917
911
  .w-40 {
918
912
  width: 10rem;
919
913
  }
914
+ .w-12 {
915
+ width: 3rem;
916
+ }
920
917
  .w-3\.5 {
921
918
  width: 0.875rem;
922
919
  }
@@ -1282,10 +1279,6 @@ video {
1282
1279
  --tw-bg-opacity: 1;
1283
1280
  background-color: rgba(187, 247, 208, var(--tw-bg-opacity));
1284
1281
  }
1285
- .bg-blue-jellyBean {
1286
- --tw-bg-opacity: 1;
1287
- background-color: rgba(39, 107, 158, var(--tw-bg-opacity));
1288
- }
1289
1282
  .bg-blue-congress {
1290
1283
  --tw-bg-opacity: 1;
1291
1284
  background-color: rgba(0, 82, 147, var(--tw-bg-opacity));
@@ -1663,10 +1656,6 @@ video {
1663
1656
  --tw-text-opacity: 1 !important;
1664
1657
  color: rgba(20, 83, 45, var(--tw-text-opacity)) !important;
1665
1658
  }
1666
- .text-blue-jellyBean {
1667
- --tw-text-opacity: 1;
1668
- color: rgba(39, 107, 158, var(--tw-text-opacity));
1669
- }
1670
1659
  .text-white {
1671
1660
  --tw-text-opacity: 1;
1672
1661
  color: rgba(255, 255, 255, var(--tw-text-opacity));
@@ -1687,6 +1676,14 @@ video {
1687
1676
  --tw-text-opacity: 1;
1688
1677
  color: rgba(0, 82, 147, var(--tw-text-opacity));
1689
1678
  }
1679
+ .text-orange-spicyCarrot {
1680
+ --tw-text-opacity: 1;
1681
+ color: rgba(211, 70, 0, var(--tw-text-opacity));
1682
+ }
1683
+ .text-blue-jellyBean {
1684
+ --tw-text-opacity: 1;
1685
+ color: rgba(39, 107, 158, var(--tw-text-opacity));
1686
+ }
1690
1687
  .text-black {
1691
1688
  --tw-text-opacity: 1;
1692
1689
  color: rgba(0, 0, 0, var(--tw-text-opacity));
@@ -1695,10 +1692,6 @@ video {
1695
1692
  --tw-text-opacity: 1;
1696
1693
  color: rgba(0, 109, 193, var(--tw-text-opacity));
1697
1694
  }
1698
- .text-orange-spicyCarrot {
1699
- --tw-text-opacity: 1;
1700
- color: rgba(211, 70, 0, var(--tw-text-opacity));
1701
- }
1702
1695
  .text-opacity-50 {
1703
1696
  --tw-text-opacity: 0.5;
1704
1697
  }
@@ -1867,7 +1860,7 @@ video {
1867
1860
  transition-timing-function: cubic-bezier(0.4, 0, 1, 1);
1868
1861
  }
1869
1862
  .counter-reset {
1870
- counter-reset: cnt1660939134937;
1863
+ counter-reset: cnt1661851888889;
1871
1864
  }
1872
1865
  .placeholder-text-xs::-webkit-input-placeholder {
1873
1866
  font-size: 0.75rem;
@@ -2250,7 +2243,7 @@ video {
2250
2243
  --tw-ring-color: rgba(255, 255, 255, 0.5);
2251
2244
  }
2252
2245
  .-ordered {
2253
- counter-increment: cnt1660939134937 1;
2246
+ counter-increment: cnt1661851888889 1;
2254
2247
  }
2255
2248
  .-ordered::before {
2256
2249
  position: absolute;
@@ -2267,7 +2260,7 @@ video {
2267
2260
  letter-spacing: .0125em;
2268
2261
  --tw-text-opacity: 1;
2269
2262
  color: rgba(0, 0, 0, var(--tw-text-opacity));
2270
- content: counter(cnt1660939134937);
2263
+ content: counter(cnt1661851888889);
2271
2264
  }
2272
2265
  /*! purgecss start ignore */
2273
2266
  :root,
@@ -2682,15 +2675,15 @@ video {
2682
2675
  --tw-bg-opacity: 1;
2683
2676
  background-color: rgba(0, 82, 147, var(--tw-bg-opacity));
2684
2677
  }
2685
- .hover\:fill-blue-jellyBean:hover {
2686
- fill: #006dc1;
2687
- }
2688
2678
  .hover\:fill-white:hover {
2689
2679
  fill: #ffffff;
2690
2680
  }
2691
2681
  .hover\:fill-orange-spicyCarrot:hover {
2692
2682
  fill: #d34600;
2693
2683
  }
2684
+ .hover\:fill-blue-jellyBean:hover {
2685
+ fill: #006dc1;
2686
+ }
2694
2687
  .hover\:text-toplineColor:hover {
2695
2688
  color: #006dc1;
2696
2689
  color: var(--color-topline);
@@ -0,0 +1,132 @@
1
+ import { fireEvent, hr$, listen, loadScript } from 'hrQuery'
2
+ import TrackingCookie from 'components/externalService/trackingCookieDs.subfeature'
3
+
4
+ const ArdPlayerLoader = function (options, rootElement) {
5
+ 'use strict'
6
+
7
+ const skinPath = options.cssUrl,
8
+ ardplayerUrl = options.jsUrl,
9
+ smarttagUrl = options.atiSmarttagUrl,
10
+ playerId = options.playerId,
11
+ trackingCookie = new TrackingCookie()
12
+ let mediaCollection = options.mediaCollection,
13
+ playerConfig = options.playerConfig,
14
+ player
15
+
16
+ const setupPlayer = function () {
17
+ if (
18
+ undefined != playerConfig.pluginData['trackingAti@all'] &&
19
+ playerConfig.pluginData['trackingAti@all'].isEnabled
20
+ ) {
21
+ playerConfig.pluginData['trackingAti@all'].config.cookieSecure =
22
+ 'https:' === document.location.protocol
23
+ }
24
+ loadArdPlayerScript()
25
+ fetchPlayerStyle(skinPath).then(createPlayer())
26
+ }
27
+
28
+ const loadArdPlayerScript = function () {
29
+ loadScript('js-ardplayerHr', ardplayerUrl)
30
+ }
31
+
32
+ const fetchPlayerStyle = function (url, id) {
33
+ return new Promise(function (resolve, reject) {
34
+ if (document.getElementById(id)) {
35
+ resolve('Style wurde bereits geladen')
36
+ console.log('style was already loaded before')
37
+ } else {
38
+ const link = document.createElement('link')
39
+ link.type = 'text/css'
40
+ link.rel = 'stylesheet'
41
+ link.id = id
42
+ link.onload = function () {
43
+ resolve()
44
+ }
45
+ link.href = url
46
+
47
+ const headScript = document.querySelector('script')
48
+ headScript.parentNode.insertBefore(link, headScript)
49
+ resolve('Style wurde neu geladen')
50
+ }
51
+ })
52
+ }
53
+
54
+ const createPlayer = function () {
55
+ if (
56
+ trackingCookie.isTrackingAccepted('ati') &&
57
+ playerConfig.pluginData['trackingAti@all'].isEnabled
58
+ ) {
59
+ loadScript('js-smarttagProd', smarttagUrl)
60
+ } else {
61
+ playerConfig.pluginData['trackingAti@all'].isEnabled = false
62
+ }
63
+ if (!trackingCookie.isTrackingAccepted('agf')) {
64
+ playerConfig.pluginData['trackingAgf@all'].isEnabled = false
65
+ }
66
+ whenAvailable('ardplayer', function () {
67
+ player = new ardplayer.Player(playerId, playerConfig, mediaCollection)
68
+ bindPlayerEvents()
69
+ })
70
+ }
71
+
72
+ const whenAvailable = function (name, callback) {
73
+ const interval = 100 // ms
74
+ const intervalId = window.setInterval(function () {
75
+ if (typeof ardplayer != 'undefined') {
76
+ window.clearInterval(intervalId)
77
+ callback(window[name])
78
+ }
79
+ }, interval)
80
+ }
81
+
82
+ const bindPlayerEvents = function () {
83
+ player.$.on(ardplayer.Player.EVENT_PLAY_STREAM, function (event) {
84
+ const geotag = hr$('.js-geotag', rootElement)[0]
85
+ if (typeof geotag != 'undefined') {
86
+ geotag.classList.add('hide')
87
+ }
88
+
89
+ fireEvent('hr:global:stopOtherAVs', 'ardplayer', true)
90
+ })
91
+
92
+ player.$.on(ardplayer.Player.EVENT_ERROR, function (event) {
93
+ if (undefined !== videoKey) {
94
+ fireEvent('hr:global:ardPlayerError', { key: videoKey }, true)
95
+ }
96
+ })
97
+
98
+ listen('hr:global:stopOtherAVs', function (event) {
99
+ if (event.detail != 'ardplayer') {
100
+ player.pause()
101
+ }
102
+ })
103
+
104
+ listen('player_closed', function (event) {
105
+ player.stop()
106
+ })
107
+
108
+ listen('player_start', function (event) {
109
+ if (player) {
110
+ if (undefined != mediaCollection.live) {
111
+ player.seekToLive()
112
+ }
113
+ player.play()
114
+ }
115
+ })
116
+ }
117
+
118
+ if (
119
+ trackingCookie.isTrackingAccepted('agf') &&
120
+ window.gfkConnector &&
121
+ playerConfig.pluginData['trackingAgf@all']
122
+ ) {
123
+ gfkConnector.init(function (gfkLinkID) {
124
+ playerConfig.pluginData['trackingAgf@all'].clipData.nol_c20 = 'p20,' + gfkLinkID
125
+ setupPlayer()
126
+ })
127
+ } else {
128
+ setupPlayer()
129
+ }
130
+ }
131
+
132
+ export default ArdPlayerLoader
@@ -0,0 +1,32 @@
1
+ import { hr$, listenOnce, listen } from 'hrQuery'
2
+ import { uxAction } from 'base/tracking/atiHelper.subfeature'
3
+ import ArdPlayerLoader from 'components/mediaplayer/ardPlayerLoader.subfeature'
4
+
5
+ const MediaplayerLoader = function (context) {
6
+ 'use strict'
7
+
8
+ const { options } = context,
9
+ { element: rootElement } = context,
10
+ isAutoplay = options.isAutoplay,
11
+ teaserSize = options.teaserSize,
12
+ mediaplayerButton = hr$('.js-mediaplayer__button', rootElement)[0]
13
+
14
+ const removeVideoHover = function () {
15
+ rootElement.parentNode.parentNode.classList.remove('-imageHover')
16
+ rootElement.parentNode.parentNode.parentNode.classList.remove('-imageHover')
17
+ }
18
+
19
+ const loadArdPlayerLoader = function () {
20
+ new ArdPlayerLoader(options)
21
+ removeVideoHover()
22
+ uxAction('mediabuttonclick::' + teaserSize + '::playButtonClick')
23
+ }
24
+
25
+ if (isAutoplay) {
26
+ console.log('isAutoplay')
27
+ listenOnce('click', loadArdPlayerLoader, mediaplayerButton)
28
+ } else {
29
+ loadArdPlayerLoader()
30
+ }
31
+ }
32
+ export default MediaplayerLoader
@@ -0,0 +1,132 @@
1
+ import { fireEvent, hr$, listen, loadScript } from 'hrQuery'
2
+ import TrackingCookie from 'components/externalService/trackingCookieDs.subfeature'
3
+
4
+ const ArdPlayerLoader = function (options, rootElement) {
5
+ 'use strict'
6
+
7
+ const skinPath = options.cssUrl,
8
+ ardplayerUrl = options.jsUrl,
9
+ smarttagUrl = options.atiSmarttagUrl,
10
+ playerId = options.playerId,
11
+ trackingCookie = new TrackingCookie()
12
+ let mediaCollection = options.mediaCollection,
13
+ playerConfig = options.playerConfig,
14
+ player
15
+
16
+ const setupPlayer = function () {
17
+ if (
18
+ undefined != playerConfig.pluginData['trackingAti@all'] &&
19
+ playerConfig.pluginData['trackingAti@all'].isEnabled
20
+ ) {
21
+ playerConfig.pluginData['trackingAti@all'].config.cookieSecure =
22
+ 'https:' === document.location.protocol
23
+ }
24
+ loadArdPlayerScript()
25
+ fetchPlayerStyle(skinPath).then(createPlayer())
26
+ }
27
+
28
+ const loadArdPlayerScript = function () {
29
+ loadScript('js-ardplayerHr', ardplayerUrl)
30
+ }
31
+
32
+ const fetchPlayerStyle = function (url, id) {
33
+ return new Promise(function (resolve, reject) {
34
+ if (document.getElementById(id)) {
35
+ resolve('Style wurde bereits geladen')
36
+ console.log('style was already loaded before')
37
+ } else {
38
+ const link = document.createElement('link')
39
+ link.type = 'text/css'
40
+ link.rel = 'stylesheet'
41
+ link.id = id
42
+ link.onload = function () {
43
+ resolve()
44
+ }
45
+ link.href = url
46
+
47
+ const headScript = document.querySelector('script')
48
+ headScript.parentNode.insertBefore(link, headScript)
49
+ resolve('Style wurde neu geladen')
50
+ }
51
+ })
52
+ }
53
+
54
+ const createPlayer = function () {
55
+ if (
56
+ trackingCookie.isTrackingAccepted('ati') &&
57
+ playerConfig.pluginData['trackingAti@all'].isEnabled
58
+ ) {
59
+ loadScript('js-smarttagProd', smarttagUrl)
60
+ } else {
61
+ playerConfig.pluginData['trackingAti@all'].isEnabled = false
62
+ }
63
+ if (!trackingCookie.isTrackingAccepted('agf')) {
64
+ playerConfig.pluginData['trackingAgf@all'].isEnabled = false
65
+ }
66
+ whenAvailable('ardplayer', function () {
67
+ player = new ardplayer.Player(playerId, playerConfig, mediaCollection)
68
+ bindPlayerEvents()
69
+ })
70
+ }
71
+
72
+ const whenAvailable = function (name, callback) {
73
+ const interval = 100 // ms
74
+ const intervalId = window.setInterval(function () {
75
+ if (typeof ardplayer != 'undefined') {
76
+ window.clearInterval(intervalId)
77
+ callback(window[name])
78
+ }
79
+ }, interval)
80
+ }
81
+
82
+ const bindPlayerEvents = function () {
83
+ player.$.on(ardplayer.Player.EVENT_PLAY_STREAM, function (event) {
84
+ const geotag = hr$('.js-geotag', rootElement)[0]
85
+ if (typeof geotag != 'undefined') {
86
+ geotag.classList.add('hide')
87
+ }
88
+
89
+ fireEvent('hr:global:stopOtherAVs', 'ardplayer', true)
90
+ })
91
+
92
+ player.$.on(ardplayer.Player.EVENT_ERROR, function (event) {
93
+ if (undefined !== videoKey) {
94
+ fireEvent('hr:global:ardPlayerError', { key: videoKey }, true)
95
+ }
96
+ })
97
+
98
+ listen('hr:global:stopOtherAVs', function (event) {
99
+ if (event.detail != 'ardplayer') {
100
+ player.pause()
101
+ }
102
+ })
103
+
104
+ listen('player_closed', function (event) {
105
+ player.stop()
106
+ })
107
+
108
+ listen('player_start', function (event) {
109
+ if (player) {
110
+ if (undefined != mediaCollection.live) {
111
+ player.seekToLive()
112
+ }
113
+ player.play()
114
+ }
115
+ })
116
+ }
117
+
118
+ if (
119
+ trackingCookie.isTrackingAccepted('agf') &&
120
+ window.gfkConnector &&
121
+ playerConfig.pluginData['trackingAgf@all']
122
+ ) {
123
+ gfkConnector.init(function (gfkLinkID) {
124
+ playerConfig.pluginData['trackingAgf@all'].clipData.nol_c20 = 'p20,' + gfkLinkID
125
+ setupPlayer()
126
+ })
127
+ } else {
128
+ setupPlayer()
129
+ }
130
+ }
131
+
132
+ export default ArdPlayerLoader
@@ -0,0 +1,30 @@
1
+ <div x-show="avStart" id="{{this.ardPlayerConfig.playerId}}" class="ar-16-9 h-auto js-load {{if _cypressHook _cypressHook 'js-media-element'}} js-video-livestream" data-hr-mediaplayer-loader='{{json this.ardPlayerJsonConfig}}'>
2
+ {{#unless _hideGeotag}}
3
+ {{~#with _geotag}}
4
+ <span class="js-geotag c-teaser__geotag" aria-hidden="true">{{this.[0].title~}}</span>
5
+ {{/with~}}
6
+ {{/unless}}
7
+ </div>
8
+ {{#if _isTeaser}}
9
+ <div class="relative {{_aspectRatio}}" x-show="!avStart" >
10
+ {{#with _teaser}}
11
+ {{~#if ../_isCopyText~}}
12
+ {{~> components/base/image/responsive_image this.teaserImage _type=(if this.teaserType this.teaserType 'story') _variant=(if this.content.imageVariant this.content.imageVariant '100-copytext') _addClassImg="ar__content" _noDelay=../_noDelay ~}}
13
+ {{else}}
14
+ {{#>components/base/link _cssClasses="c-teaser__mediaLink" _isAriaHidden=true
15
+ _doTracking=(if this.doTracking 'true') _clickLabelPrefix1=this.realTeasersize
16
+ _clickLabelPrefix2="mediaLink" }}
17
+ {{~> components/base/image/responsive_image this.teaserImage _type=(if this.teaserType this.teaserType 'story') _variant=(if this.content.imageVariant this.content.imageVariant '100-copytext') _addClassImg="js-mediaplayer__area ar__content mediaPlayerLoader__mediaplayerArea" _noDelay=../_noDelay ~}}
18
+ {{/components/base/link }}
19
+ {{/if}}
20
+ {{/with}}
21
+ {{> components/button/button_round _isButton="true" _addClass=(if _isLivestream 'absolute bottom-0 right-0 my-5 mx-5 text-orange-spicyCarrot hover:fill-orange-spicyCarrot js-mediaplayer__button' 'absolute bottom-0 right-0 my-5 mx-5 text-blue-jellyBean hover:fill-blue-jellyBean js-mediaplayer__button') _showIcon=true _icon=_mediaButtonIcon _label=_mediaButtonLabel _srOnly="true" _alpineClick="avStart = !avStart; $dispatch('player_start')"}}
22
+ {{~#if _isPodcast~}}
23
+ <a href="{{this.podcastDownloadUrl}}" class="downloadLink button-invert js-load"{{#with
24
+ this.trackingData}}
25
+ data-hr-click-tracking='{"settings": [{"type": "download", "clickLabel": "{{this.pageName}}", "secondLevelId": "{{this.secondLevelId}}"}, {"type": "uxAction", "clickLabel": "medienDownload::podcast::{{_type}}", "secondLevelId": "{{this.secondLevelId}}" }]}'{{/with}}>
26
+ {{> components/base/image/icon _icon='download-button' _addClass="icon--media"}}
27
+ </a>
28
+ {{~/if~}}
29
+ </div>
30
+ {{/if}}
@@ -0,0 +1,32 @@
1
+ import { hr$, listenOnce, listen } from 'hrQuery'
2
+ import { uxAction } from 'base/tracking/atiHelper.subfeature'
3
+ import ArdPlayerLoader from 'components/mediaplayer/ardPlayerLoader.subfeature'
4
+
5
+ const MediaplayerLoader = function (context) {
6
+ 'use strict'
7
+
8
+ const { options } = context,
9
+ { element: rootElement } = context,
10
+ isAutoplay = options.isAutoplay,
11
+ teaserSize = options.teaserSize,
12
+ mediaplayerButton = hr$('.js-mediaplayer__button', rootElement)[0]
13
+
14
+ const removeVideoHover = function () {
15
+ rootElement.parentNode.parentNode.classList.remove('-imageHover')
16
+ rootElement.parentNode.parentNode.parentNode.classList.remove('-imageHover')
17
+ }
18
+
19
+ const loadArdPlayerLoader = function () {
20
+ new ArdPlayerLoader(options)
21
+ removeVideoHover()
22
+ uxAction('mediabuttonclick::' + teaserSize + '::playButtonClick')
23
+ }
24
+
25
+ if (isAutoplay) {
26
+ console.log('isAutoplay')
27
+ listenOnce('click', loadArdPlayerLoader, mediaplayerButton)
28
+ } else {
29
+ loadArdPlayerLoader()
30
+ }
31
+ }
32
+ export default MediaplayerLoader
@@ -1,14 +1,18 @@
1
1
  {{#with this.teaserLead.avDocument}}
2
2
  {{~#if this.isVideo ~}}
3
- {{~> components/video/video_element _isTeaser=true _teaser=../this _aspectRatio=../_aspectRatio _teaserSize=../_teaserSize ~}}
3
+ {{~> components/mediaplayer/media_player this.toModel.videoElement _cypressHook="js-video-ondemand" _mediaButtonIcon="play_button" _mediaButtonLabel="Video" _isTeaser=true _teaser=../this _aspectRatio=../_aspectRatio _teaserSize=../_teaserSize ~}}
4
4
  {{~/if~}}
5
5
  {{~#if this.isAudio ~}}
6
- {{~> components/audio/audio_element _isTeaser=true _teaser=../this _audioUrl=this.audioUrl _variant=this.imageVariant _noDelay=../_noDelay _aspectRatio=../_aspectRatio _isMobile1to1=../_isMobile1to1 _teaserSize=../_teaserSize~}}
6
+ {{~> components/mediaplayer/media_player this.toModel.audioElement _cypressHook="js-audio-ondemand" _mediaButtonIcon="audio_button" _mediaButtonLabel="Audio" _isTeaser=true _teaser=../this _audioUrl=this.audioUrl _variant=this.imageVariant _noDelay=../_noDelay _aspectRatio=../_aspectRatio _isMobile1to1=../_isMobile1to1 _teaserSize=../_teaserSize~}}
7
+ {{~/if~}}
8
+ {{~#if this.isAudioEventLivestream ~}}
9
+ {{~> components/mediaplayer/media_player this.toModel.audioLivestreamElement _cypressHook="js-video-livestream" _mediaButtonIcon="play_button" _mediaButtonLabel="Live" _isLivestream="true" _isTeaser=true _teaser=../this _audioUrl=this.audioUrl _variant=this.imageVariant _noDelay=../_noDelay _aspectRatio=../_aspectRatio _isMobile1to1=../_isMobile1to1 _teaserSize=../_teaserSize~}}
7
10
  {{~/if~}}
8
11
  {{~#if this.isLivestream ~}}
9
- {{~> components/video/livestream/video_livestream _isTeaser=true _teaser=../this _audioUrl=this.audioUrl _variant=this.imageVariant _noDelay=../_noDelay _aspectRatio=../_aspectRatio _isMobile1to1=../_isMobile1to1 _teaserSize=../_teaserSize~}}
12
+ {{~> components/mediaplayer/media_player this.toModel.videoLivestreamElement _cypressHook="js-video-livestream" _mediaButtonIcon="play_button" _mediaButtonLabel="Live" _isLivestream="true" _isTeaser=true _teaser=../this _audioUrl=this.audioUrl _variant=this.imageVariant _noDelay=../_noDelay _aspectRatio=../_aspectRatio _isMobile1to1=../_isMobile1to1 _teaserSize=../_teaserSize~}}
10
13
  {{~/if~}}
14
+
11
15
  {{/with}}
12
16
  {{#if _isMobile1to1~}}
13
- {{> components/button/button_transparent _showIcon="true" _title="Mediaplayer schließen" _icon="arrow-up" _iconmap="icons"_addIconClass="w-3 h-3 fill-current" _addClass="md:hidden absolute top-full right-0" _x-show="avStart" _alpineClick="avStart = false; $dispatch('player_colosed')"}}
17
+ {{> components/button/button_transparent _showIcon="true" _title="Mediaplayer schließen" _icon="arrow-up" _iconmap="icons"_addIconClass="w-3 h-3 fill-current" _addClass="md:hidden absolute top-full right-0" _x-show="avStart" _alpineClick="avStart = false; $dispatch('player_closed')"}}
14
18
  {{~/if~}}
package/package.json CHANGED
@@ -6,7 +6,7 @@
6
6
  "license": "MIT",
7
7
  "main": "dist/index.js",
8
8
  "repository": "https://github.com/szuelch/hr-design-system-handlebars",
9
- "version": "0.55.3",
9
+ "version": "0.56.0",
10
10
  "scripts": {
11
11
  "test": "echo \"Error: no test specified\" && exit 1",
12
12
  "storybook": "start-storybook -p 6006 public",