hr-design-system-handlebars 0.49.2 → 0.49.3

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 (32) hide show
  1. package/.storybook/main.js +3 -2
  2. package/.storybook/preview.js +13 -6
  3. package/CHANGELOG.md +12 -0
  4. package/dist/views/base/tracking/{atiHelperNew.js → atiHelperDs.js} +1 -1
  5. package/dist/views/base/tracking/{atiMediaHelperNew.js → atiMediaHelperDs.js} +1 -1
  6. package/{src/stories/views/components/audio/audioElement.subfeature.js → dist/views/components/audio/audioElementDs.subfeature.js} +3 -3
  7. package/dist/views/components/button/button_round.hbs +3 -0
  8. package/{src/stories/views/components/externalService/trackingCookie.subfeature.js → dist/views/components/externalService/trackingCookieDs.subfeature.js} +1 -1
  9. package/dist/views/components/foo.feature.js +1 -1
  10. package/dist/views/components/generic/{hrQueryNew.js → hrQueryDs.js} +0 -0
  11. package/dist/views/components/mediaplayer/{mediaplayerLoader.feature.js → mediaplayerLoaderDs.feature.js} +36 -14
  12. package/dist/views/components/teaser/teaser_standard.hbs +14 -1
  13. package/{src/stories/views/components/video/livestream/videoLivestream.subfeature.js → dist/views/components/video/livestream/videoLivestreamDs.subfeature.js} +2 -2
  14. package/{src/stories/views/components/video/videoOnDemandPlayer.subfeature.js → dist/views/components/video/videoOnDemandPlayerDs.subfeature.js} +20 -5
  15. package/dist/views/components/video/video_element.hbs +16 -9
  16. package/package.json +1 -1
  17. package/src/assets/fixtures/teaser/teaser_standard_25_serif_av_consumption.json +28 -0
  18. package/src/stories/views/base/tracking/{atiHelperNew.js → atiHelperDs.js} +1 -1
  19. package/src/stories/views/base/tracking/{atiMediaHelperNew.js → atiMediaHelperDs.js} +1 -1
  20. package/{dist/views/components/audio/audioElement.subfeature.js → src/stories/views/components/audio/audioElementDs.subfeature.js} +3 -3
  21. package/src/stories/views/components/button/button_round.hbs +3 -0
  22. package/{dist/views/components/externalService/trackingCookie.subfeature.js → src/stories/views/components/externalService/trackingCookieDs.subfeature.js} +1 -1
  23. package/src/stories/views/components/foo.feature.js +1 -1
  24. package/src/stories/views/components/generic/{hrQueryNew.js → hrQueryDs.js} +0 -0
  25. package/src/stories/views/components/mediaplayer/{mediaplayerLoader.feature.js → mediaplayerLoaderDs.feature.js} +36 -14
  26. package/src/stories/views/components/teaser/fixtures/teaser_standard_25_serif_av_consumption.json +1 -0
  27. package/src/stories/views/components/teaser/fixtures/teaser_standard_50_serif_av_consumption copy.json +1 -0
  28. package/src/stories/views/components/teaser/teaser_standard.hbs +14 -1
  29. package/src/stories/views/components/teaser/teaser_standard_av.stories.mdx +4 -0
  30. package/{dist/views/components/video/livestream/videoLivestream.subfeature.js → src/stories/views/components/video/livestream/videoLivestreamDs.subfeature.js} +2 -2
  31. package/{dist/views/components/video/videoOnDemandPlayer.subfeature.js → src/stories/views/components/video/videoOnDemandPlayerDs.subfeature.js} +20 -5
  32. package/src/stories/views/components/video/video_element.hbs +16 -9
@@ -34,10 +34,11 @@ module.exports = {
34
34
  ...config.resolve.alias,
35
35
  scripts: path.resolve(__dirname, '../scripts'),
36
36
  components: path.resolve(__dirname, '../src/stories/views/components'),
37
+ base: path.resolve(__dirname, '../src/stories/views/base'),
37
38
  tailwind$: path.resolve(__dirname, '../src/assets/tailwind.css'),
38
- hrQueryNew$: path.resolve(
39
+ hrQueryDs$: path.resolve(
39
40
  __dirname,
40
- '../src/stories/views/components/generic/hrQueryNew.js'
41
+ '../src/stories/views/components/generic/hrQueryDs.js'
41
42
  ),
42
43
  initializer$: path.resolve(
43
44
  __dirname,
@@ -11,14 +11,21 @@ import loadFeature from '../build/webpack/feature-loader/initializer/loader'
11
11
  import 'components/site_header/header_alpine'
12
12
 
13
13
  function loadDelayedImages(){setTimeout((function(){var t,e=document.images,s=[],a=function(t){void 0!==window.picturefill&&window.picturefill({reevaluate:!0,elements:t})};for(var i=0;i<e.length;++i)(t=e[i].dataset?e[i].dataset.srcset:e[i].getAttribute("data-srcset"))&&(0===e[i].getBoundingClientRect().top?s.push(e[i]):e[i].setAttribute("srcset",t));a(e),setTimeout((function(){var t;for(var i=0;i<s.length;++i)t=s[i].dataset?s[i].dataset.srcset:s[i].getAttribute("data-srcset"),s[i].setAttribute("srcset",t);a(s)}),900)}),0)}
14
-
15
- document.addEventListener('DOMContentLoaded', function (event) {
16
- console.log('DOM fully loaded and parsed')
17
14
 
18
- console.log('Start feature initialization')
15
+ let eventSrcUrl = null;
16
+
17
+ document.addEventListener('DOMContentLoaded', function (event) {
18
+ console.log('DOM fully loaded and parsed')
19
+ if(eventSrcUrl != event.srcElement.URL) {
20
+ eventSrcUrl = event.srcElement.URL
21
+
22
+ console.log('Start feature initialization' )
19
23
 
20
- Initializer.run(document, loadFeature)
21
- setTimeout(loadDelayedImages,200);
24
+ Initializer.run(document, loadFeature)
25
+ setTimeout(loadDelayedImages,200);
26
+ } else {
27
+ console.log("second DOMContentLoaded Event was blocked!");
28
+ }
22
29
  })
23
30
 
24
31
  if (process.env.NODE_ENV !== 'production') {
package/CHANGELOG.md CHANGED
@@ -1,3 +1,15 @@
1
+ # v0.49.3 (Tue Jul 05 2022)
2
+
3
+ #### 🐛 Bug Fix
4
+
5
+ - Dpe 1588 [#261](https://github.com/mumprod/hr-design-system-handlebars/pull/261) ([@vascoeduardo](https://github.com/vascoeduardo))
6
+
7
+ #### Authors: 1
8
+
9
+ - Vasco ([@vascoeduardo](https://github.com/vascoeduardo))
10
+
11
+ ---
12
+
1
13
  # v0.49.2 (Tue Jul 05 2022)
2
14
 
3
15
  #### 🐛 Bug Fix
@@ -1,5 +1,5 @@
1
1
 
2
- import TrackingCookie from '../../components/externalService/trackingCookie.subfeature'
2
+ import TrackingCookie from 'components/externalService/trackingCookieDs.subfeature'
3
3
 
4
4
  const isTrackingAllowed = () => {
5
5
  const trackingCookie = new TrackingCookie()
@@ -1,4 +1,4 @@
1
- import { isTrackingAllowed, pi } from '../tracking/atiHelperNew'
1
+ import { isTrackingAllowed, pi } from 'base/tracking/atiHelperDs'
2
2
 
3
3
  const ATIMediaHelper = function (
4
4
  avType,
@@ -1,6 +1,6 @@
1
- import { fireEvent, hr$, listen } from 'hrQueryNew'
2
- import { uxAction } from '../../base/tracking/atiHelperNew'
3
- import ATIMediaHelper from '../../base/tracking/atiMediaHelperNew'
1
+ import { fireEvent, hr$, listen } from 'hrQueryDs'
2
+ import { uxAction } from 'base/tracking/atiHelperDs'
3
+ import ATIMediaHelper from 'base/tracking/atiMediaHelperDs'
4
4
 
5
5
  const AudioElement = function (options, rootElement) {
6
6
  'use strict'
@@ -4,6 +4,9 @@
4
4
  {{~#if _name}} name="{{_name}}"{{/if}}
5
5
  class="bg-blue-500 hover:bg-blue-700 text-white rounded-full border-4 border-white p-1 {{_addClass}}{{#if _webview}} -webview{{/if}}"
6
6
  {{~#if _value}} value="{{_value}}"{{/if}}
7
+ {{~#if _alpineClick}} @click="{{_alpineClick}}"{{/if}}
8
+
9
+
7
10
  >
8
11
  {{~#if _showIcon~}}
9
12
  {{> components/base/image/icon _icon=_icon _iconmap=_iconmap _addClass=_addIconClass _webview=_webview}}
@@ -1,4 +1,4 @@
1
- import { getJSONCookie, setJSONCookie } from 'hrQueryNew'
1
+ import { getJSONCookie, setJSONCookie } from 'hrQueryDs'
2
2
 
3
3
  const TrackingCookie = function () {
4
4
  let cookie = {}
@@ -1,4 +1,4 @@
1
- import { hr$ } from 'hrQueryNew'
1
+ import { hr$ } from 'hrQueryDs'
2
2
  const Foo = (context) => {
3
3
  const { options } = context
4
4
  const { element: rootElement } = context
@@ -1,8 +1,8 @@
1
- import { hr$, listenOnce } from 'hrQueryNew'
2
- import { uxAction } from '../../base/tracking/atiHelperNew'
3
- import VideoOnDemandPlayer from '../video/videoOnDemandPlayer.subfeature'
4
- import AudioElement from '../audio/audioElement.subfeature'
5
- import VideoLivestream from '../video/livestream/videoLivestream.subfeature'
1
+ import { hr$, listenOnce, fireEvent, listen } from 'hrQueryDs'
2
+ import { uxAction } from 'base/tracking/atiHelperDs'
3
+ import VideoOnDemandPlayer from 'components/video/videoOnDemandPlayerDs.subfeature'
4
+ import AudioElement from 'components/audio/audioElementDs.subfeature'
5
+ import VideoLivestream from 'components/video/livestream/videoLivestreamDs.subfeature'
6
6
 
7
7
  const MediaplayerLoader = function (context) {
8
8
  'use strict'
@@ -14,9 +14,14 @@ const MediaplayerLoader = function (context) {
14
14
  position = options.position,
15
15
  teaserSize = options.teaserSize,
16
16
  config = options.config,
17
- audioContent = hr$('.js-audioElement__audio', rootElement)[0],
18
- mediaplayerButton = hr$('.js-mediaplayer__button', rootElement)[0]
19
-
17
+ audioContent = hr$('.js-audioElement__audio', rootElement)[0],
18
+ // containerId = options.containerId,
19
+ rootParent = rootElement.parentNode,
20
+ mediaplayerButton = hr$('.js-mediaplayer__button', rootParent)[0];
21
+
22
+ let video = false;
23
+
24
+
20
25
  const removeVideoHover = function () {
21
26
  rootElement.parentNode.parentNode.classList.remove('-imageHover')
22
27
  rootElement.parentNode.parentNode.parentNode.classList.remove('-imageHover')
@@ -35,11 +40,24 @@ const MediaplayerLoader = function (context) {
35
40
  uxAction('mediabuttonclick::' + teaserSize + '::playButtonClick')
36
41
  }
37
42
 
38
- const loadOnDemand = function () {
39
- console.log("loadOnDemand");
40
- new VideoOnDemandPlayer(options)
41
- removeVideoHover()
42
- uxAction('mediabuttonclick::' + teaserSize + '::playButtonClick')
43
+
44
+ const unloadPlayer = function() {
45
+ console.log("video.pause()");
46
+ video.pause();
47
+ }
48
+
49
+ const loadOnDemand = function () {
50
+ if(!video){
51
+ console.log("loadOnDemand");
52
+ video = new VideoOnDemandPlayer(options)
53
+ removeVideoHover()
54
+ uxAction('mediabuttonclick::' + teaserSize + '::playButtonClick')
55
+ listenOnce('player_colosed', unloadPlayer)
56
+ } else {
57
+ console.log("video.play()");
58
+ listenOnce('player_colosed', unloadPlayer)
59
+ video.play();
60
+ }
43
61
  }
44
62
 
45
63
  const loadAudio = function () {
@@ -48,6 +66,8 @@ const MediaplayerLoader = function (context) {
48
66
  uxAction('mediabuttonclick::' + teaserSize + '::playButtonClick')
49
67
  }
50
68
 
69
+
70
+
51
71
  switch (type) {
52
72
  case 'live':
53
73
  console.log('live');
@@ -61,7 +81,8 @@ const MediaplayerLoader = function (context) {
61
81
  case 'ondemand':
62
82
  console.log('ondemand');
63
83
  if (position === 'teaser') {
64
- listenOnce('click', loadOnDemand, mediaplayerButton)
84
+ // listenOnce('click', loadOnDemand, mediaplayerButton)
85
+ listen('click', loadOnDemand, mediaplayerButton)
65
86
  } else {
66
87
  loadOnDemand()
67
88
  }
@@ -77,5 +98,6 @@ const MediaplayerLoader = function (context) {
77
98
  }
78
99
  break
79
100
  }
101
+
80
102
  }
81
103
  export default MediaplayerLoader
@@ -1,8 +1,21 @@
1
- <article class="col-span-12 flex gap-y-3 gap-x-4 {{inline-switch this.teaserSize '["25","33","50"]' '["px-5 md:px-0 md:col-span-3 flex-row md:flex-col","md:col-span-4 flex-col","md:col-span-6 flex-col","flex-col"]'}} ">
1
+ <article class="col-span-12 flex gap-y-3 gap-x-4 {{inline-switch this.teaserSize '["25","33","50"]' '["js-is1to1 px-5 md:px-0 md:col-span-3 md:flex-col","md:col-span-4 flex-col","md:col-span-6 flex-col","flex-col"]'}} "
2
+ x-data="{ videoStart: false }"
3
+ {{#switch this.teaserSize~}}
4
+ {{~#case "25"}}
5
+
6
+ :class="videoStart ? 'flex-col' : 'flex-row'"
7
+ {{/case~}}
8
+ {{~/switch~}}
9
+ >
2
10
  <figure class="relative {{inline-switch this.teaserSize '["25"]' '["basis-2/5 md:flex-full ar-1-1 md:ar-16-9", "ar-16-9"]'}} ">
3
11
  {{> components/teaser/components/teaser_lead }}
4
12
  </figure>
5
13
  <div class="{{inline-switch this.teaserSize '["25"]' '["basis-3/5 md:flex-full"]'}} ">
14
+ {{#switch this.teaserSize~}}
15
+ {{~#case "25"}}
16
+ <button x-show="videoStart" @click="videoStart = false; $dispatch('player_colosed')" class="md:hidden">Video schließen</button>
17
+ {{/case~}}
18
+ {{~/switch~}}
6
19
  <header class="md:px-0 {{inline-switch teaserSize '["25"]' '["","px-5"]'}}">
7
20
  {{#>components/base/link css="hover:text-toplineColor" doTracking=(if this.doTracking 'true') clickLabelPrefix1=this.teaserSize clickLabelPrefix2="headlineLink" }}
8
21
  {{> components/teaser/components/teaser_heading
@@ -1,5 +1,5 @@
1
- import { fireEvent, hr$, listen, loadScript } from 'hrQueryNew'
2
- import TrackingCookie from '../../externalService/trackingCookie.subfeature'
1
+ import { fireEvent, hr$, listen, loadScript } from 'hrQueryDs'
2
+ import TrackingCookie from 'components/externalService/trackingCookieDs.subfeature'
3
3
 
4
4
  const VideoLivestream = function (options, rootElement) {
5
5
  'use strict'
@@ -1,5 +1,5 @@
1
- import { fireEvent, hr$, listen, loadScript } from 'hrQueryNew'
2
- import TrackingCookie from '../externalService/trackingCookie.subfeature'
1
+ import { fireEvent, hr$, listen, loadScript } from 'hrQueryDs'
2
+ import TrackingCookie from 'components/externalService/trackingCookieDs.subfeature'
3
3
 
4
4
  const VideoOnDemandPlayer = function (options, rootElement) {
5
5
  'use strict'
@@ -28,8 +28,8 @@ console.log('VideoOnDemandPlayer');
28
28
  mediaCollection,
29
29
  mediaStreamArray = []
30
30
 
31
- console.log(skinPath);
32
- /* console.log(isAdaptiveStream);
31
+ /* console.log(skinPath);
32
+ console.log(isAdaptiveStream);
33
33
  console.log(basePlayerUrl);
34
34
  console.log(previewImageUrl);
35
35
  console.log(adaptiveStreamingUrl);
@@ -341,8 +341,14 @@ console.log('VideoOnDemandPlayer');
341
341
  player.pause()
342
342
  }
343
343
  })
344
+ // listen('hr:global:startVideo:'+playerId, function (event) {
345
+ // if (event.detail == 'ardplayer') {
346
+ // player.play()
347
+ // }
348
+ // })
349
+
344
350
  }
345
-
351
+
346
352
  if (trackingCookie.isTrackingAccepted('agf') && window.gfkConnector && agfMetadata) {
347
353
  gfkConnector.init(function (gfkLinkID) {
348
354
  agfMetadata.nol_c20 = 'p20,' + gfkLinkID
@@ -351,6 +357,15 @@ console.log('VideoOnDemandPlayer');
351
357
  } else {
352
358
  setupPlayer()
353
359
  }
360
+
361
+ return {
362
+ play: function() {
363
+ player.play()
364
+ },
365
+ pause: function() {
366
+ player.pause()
367
+ }
368
+ }
354
369
  }
355
370
 
356
371
  export default VideoOnDemandPlayer
@@ -1,5 +1,5 @@
1
1
  <div class="c-videoplayer">
2
- <div id="{{nextRandom}}" class="relative js-load" data-new-hr-mediaplayer-loader='{
2
+ <div x-show="videoStart" x-transition.duration.100ms id="{{nextRandom}}" class="js-load" data-new-hr-mediaplayer-loader-ds='{
3
3
  "type": "ondemand",
4
4
  "position": "{{if _isTeaser 'teaser' 'page'}}",
5
5
  "teaserSize" : "{{if ../../this.teasersize ../../this.teasersize '00' }}",
@@ -59,19 +59,26 @@
59
59
  <span class="js-geotag c-teaser__geotag" aria-hidden="true">{{this.[0].title~}}</span>
60
60
  {{/with~}}
61
61
  {{/unless}}
62
- {{#if _isTeaser}}
63
- {{#with _teaser}}
62
+
63
+ </div>
64
+
65
+ {{#if _isTeaser}}
66
+ <div class="relative" x-show="!videoStart" x-transition.duration.100ms>
67
+ {{#with _teaser}}
68
+
64
69
  {{~#if ../_isCopyText~}}
65
70
  {{~> 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 ~}}
66
71
  {{else}}
67
72
  {{#>components/base/link _cssClasses="c-teaser__mediaLink" _isAriaHidden=true
68
- _doTracking=(if this.doTracking 'true') _clickLabelPrefix1=this.realTeasersize
69
- _clickLabelPrefix2="mediaLink" }}
73
+ _doTracking=(if this.doTracking 'true') _clickLabelPrefix1=this.realTeasersize
74
+ _clickLabelPrefix2="mediaLink" }}
70
75
  {{~> 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 ~}}
71
76
  {{/components/base/link }}
72
77
  {{/if}}
73
- {{/with}}
74
- {{> components/button/button_round _isButton="true" _addClass="absolute bottom-0 right-0 my-4 mx-4 js-mediaplayer__button" _showIcon=true _icon="play" _addIconClass="w-6 h-6 inline" _label="Video"}}
75
- {{/if}}
76
- </div>
78
+
79
+ {{/with}}
80
+ {{> components/button/button_round _isButton="true" _addClass="absolute bottom-0 right-0 my-4 mx-4 js-mediaplayer__button" _showIcon=true _icon="play" _addIconClass="w-6 h-6 inline" _label="Video" _alpineClick="videoStart = !videoStart"}}
81
+ </div>
82
+ {{/if}}
83
+
77
84
  </div>
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.49.2",
9
+ "version": "0.49.3",
10
10
  "scripts": {
11
11
  "test": "echo \"Error: no test specified\" && exit 1",
12
12
  "storybook": "start-storybook -p 6006 public",
@@ -0,0 +1,28 @@
1
+ {
2
+ "@->jsoninclude": "teaser/teasers.inc.json",
3
+ "@->contentpath": "teaser",
4
+ "@->overrides": [
5
+ {
6
+ "@->contentpath": "logicItem.includeModel.teaserSize",
7
+ "@->value": "25"
8
+ },
9
+ {
10
+ "@->contentpath": "logicItem.includeModel.allowAVConsumption",
11
+ "@->value": "true"
12
+ },
13
+ {
14
+ "@->contentpath": "logicItem.includeModel.teaserLead",
15
+ "@->value": {
16
+ "@->jsoninclude": "teaser/teaser_lead.inc.json",
17
+ "@->contentpath": "video"
18
+ }
19
+ },
20
+ {
21
+ "@->contentpath": "logicItem.includeModel.teaserImage",
22
+ "@->value": {
23
+ "@->jsoninclude": "teaser/teaser_images.inc.json",
24
+ "@->contentpath": "sm_4"
25
+ }
26
+ }
27
+ ]
28
+ }
@@ -1,5 +1,5 @@
1
1
 
2
- import TrackingCookie from '../../components/externalService/trackingCookie.subfeature'
2
+ import TrackingCookie from 'components/externalService/trackingCookieDs.subfeature'
3
3
 
4
4
  const isTrackingAllowed = () => {
5
5
  const trackingCookie = new TrackingCookie()
@@ -1,4 +1,4 @@
1
- import { isTrackingAllowed, pi } from '../tracking/atiHelperNew'
1
+ import { isTrackingAllowed, pi } from 'base/tracking/atiHelperDs'
2
2
 
3
3
  const ATIMediaHelper = function (
4
4
  avType,
@@ -1,6 +1,6 @@
1
- import { fireEvent, hr$, listen } from 'hrQueryNew'
2
- import { uxAction } from '../../base/tracking/atiHelperNew'
3
- import ATIMediaHelper from '../../base/tracking/atiMediaHelperNew'
1
+ import { fireEvent, hr$, listen } from 'hrQueryDs'
2
+ import { uxAction } from 'base/tracking/atiHelperDs'
3
+ import ATIMediaHelper from 'base/tracking/atiMediaHelperDs'
4
4
 
5
5
  const AudioElement = function (options, rootElement) {
6
6
  'use strict'
@@ -4,6 +4,9 @@
4
4
  {{~#if _name}} name="{{_name}}"{{/if}}
5
5
  class="bg-blue-500 hover:bg-blue-700 text-white rounded-full border-4 border-white p-1 {{_addClass}}{{#if _webview}} -webview{{/if}}"
6
6
  {{~#if _value}} value="{{_value}}"{{/if}}
7
+ {{~#if _alpineClick}} @click="{{_alpineClick}}"{{/if}}
8
+
9
+
7
10
  >
8
11
  {{~#if _showIcon~}}
9
12
  {{> components/base/image/icon _icon=_icon _iconmap=_iconmap _addClass=_addIconClass _webview=_webview}}
@@ -1,4 +1,4 @@
1
- import { getJSONCookie, setJSONCookie } from 'hrQueryNew'
1
+ import { getJSONCookie, setJSONCookie } from 'hrQueryDs'
2
2
 
3
3
  const TrackingCookie = function () {
4
4
  let cookie = {}
@@ -1,4 +1,4 @@
1
- import { hr$ } from 'hrQueryNew'
1
+ import { hr$ } from 'hrQueryDs'
2
2
  const Foo = (context) => {
3
3
  const { options } = context
4
4
  const { element: rootElement } = context
@@ -1,8 +1,8 @@
1
- import { hr$, listenOnce } from 'hrQueryNew'
2
- import { uxAction } from '../../base/tracking/atiHelperNew'
3
- import VideoOnDemandPlayer from '../video/videoOnDemandPlayer.subfeature'
4
- import AudioElement from '../audio/audioElement.subfeature'
5
- import VideoLivestream from '../video/livestream/videoLivestream.subfeature'
1
+ import { hr$, listenOnce, fireEvent, listen } from 'hrQueryDs'
2
+ import { uxAction } from 'base/tracking/atiHelperDs'
3
+ import VideoOnDemandPlayer from 'components/video/videoOnDemandPlayerDs.subfeature'
4
+ import AudioElement from 'components/audio/audioElementDs.subfeature'
5
+ import VideoLivestream from 'components/video/livestream/videoLivestreamDs.subfeature'
6
6
 
7
7
  const MediaplayerLoader = function (context) {
8
8
  'use strict'
@@ -14,9 +14,14 @@ const MediaplayerLoader = function (context) {
14
14
  position = options.position,
15
15
  teaserSize = options.teaserSize,
16
16
  config = options.config,
17
- audioContent = hr$('.js-audioElement__audio', rootElement)[0],
18
- mediaplayerButton = hr$('.js-mediaplayer__button', rootElement)[0]
19
-
17
+ audioContent = hr$('.js-audioElement__audio', rootElement)[0],
18
+ // containerId = options.containerId,
19
+ rootParent = rootElement.parentNode,
20
+ mediaplayerButton = hr$('.js-mediaplayer__button', rootParent)[0];
21
+
22
+ let video = false;
23
+
24
+
20
25
  const removeVideoHover = function () {
21
26
  rootElement.parentNode.parentNode.classList.remove('-imageHover')
22
27
  rootElement.parentNode.parentNode.parentNode.classList.remove('-imageHover')
@@ -35,11 +40,24 @@ const MediaplayerLoader = function (context) {
35
40
  uxAction('mediabuttonclick::' + teaserSize + '::playButtonClick')
36
41
  }
37
42
 
38
- const loadOnDemand = function () {
39
- console.log("loadOnDemand");
40
- new VideoOnDemandPlayer(options)
41
- removeVideoHover()
42
- uxAction('mediabuttonclick::' + teaserSize + '::playButtonClick')
43
+
44
+ const unloadPlayer = function() {
45
+ console.log("video.pause()");
46
+ video.pause();
47
+ }
48
+
49
+ const loadOnDemand = function () {
50
+ if(!video){
51
+ console.log("loadOnDemand");
52
+ video = new VideoOnDemandPlayer(options)
53
+ removeVideoHover()
54
+ uxAction('mediabuttonclick::' + teaserSize + '::playButtonClick')
55
+ listenOnce('player_colosed', unloadPlayer)
56
+ } else {
57
+ console.log("video.play()");
58
+ listenOnce('player_colosed', unloadPlayer)
59
+ video.play();
60
+ }
43
61
  }
44
62
 
45
63
  const loadAudio = function () {
@@ -48,6 +66,8 @@ const MediaplayerLoader = function (context) {
48
66
  uxAction('mediabuttonclick::' + teaserSize + '::playButtonClick')
49
67
  }
50
68
 
69
+
70
+
51
71
  switch (type) {
52
72
  case 'live':
53
73
  console.log('live');
@@ -61,7 +81,8 @@ const MediaplayerLoader = function (context) {
61
81
  case 'ondemand':
62
82
  console.log('ondemand');
63
83
  if (position === 'teaser') {
64
- listenOnce('click', loadOnDemand, mediaplayerButton)
84
+ // listenOnce('click', loadOnDemand, mediaplayerButton)
85
+ listen('click', loadOnDemand, mediaplayerButton)
65
86
  } else {
66
87
  loadOnDemand()
67
88
  }
@@ -77,5 +98,6 @@ const MediaplayerLoader = function (context) {
77
98
  }
78
99
  break
79
100
  }
101
+
80
102
  }
81
103
  export default MediaplayerLoader
@@ -0,0 +1 @@
1
+ {"isSsi":true,"logicItem":{"includePath":"components/teaser/teaser_standard","includeModel":{"byline":"Byline","title":"Abgeschobene Geschwister aus Syrien zurück in Wolfhagen","topline":"Überglücklich, aber ohne Mama","headingFontVariant":"serif","extendedTitle":"","teaserType":"standard-ds","teaserSize":"25","teaserDate":{"htmlDateTime":"2022-04-17T19:30+0200","htmlDate":"20.02.1983","date":"17.04.22","dateSeparatorTime":"17.04.22, 19:30"},"teaserInfo":{"showTeaserInfo":true,"showTeaserInfoSection":true,"showTeaserInfoChannel":true,"showTeaserInfoAll":true,"showTeaserInfoDate":false,"showTeaserInfoDateTime":true,"showTeaserInfoProgramRef":true},"teaserImage":{"alttext":"Lorem ipsum","copyrightWithLinks":"","responsiveImage":{"asPicture":true,"asImage":false,"fallback":"https://picsum.photos/id/191/480/270","sources":[{"media":"all and (max-width: 39.938em)","sizes":"40vw","srcset":"https://picsum.photos/id/191/320/320 320w, https://picsum.photos/id/191/480/480 480w, https://picsum.photos/id/191/640/640 640w, https://picsum.photos/id/191/960/960 960w"},{"media":"all and (min-width: 40em) and (max-width: 58.938em)","sizes":"25vw","srcset":"https://picsum.photos/id/191/320/180 320w, https://picsum.photos/id/191/480/270 480w, https://picsum.photos/id/191/640/360 640w, https://picsum.photos/id/191/960/540 960w"},{"media":"all and (min-width: 59em)","sizes":"218px","srcset":"https://picsum.photos/id/191/320/180 320w, https://picsum.photos/id/191/480/270 480w, https://picsum.photos/id/191/640/360 640w"}]}},"hasMediaButtons":false,"dontLazyload":true,"isStandardTeaser":true,"isHeroTeaser":true,"isMediaTeaser":false,"isGuide":false,"isProgram":false,"isEvent":false,"isTicker":false,"isAudio":false,"isVideo":false,"isPodcastEpisode":false,"isExtOrBrandLink":false,"isAuthor":false,"copyright":"Copyright Text","audioAuthor":"Audio Author","hasStatus":false,"hasTeaserItem":true,"allowAVConsumption":"true","displayEpgInfos":false,"aspectRatio":"ar--teaserTop","hideGeotag":false,"hideEditableByline":true,"doTracking":true,"trackingForArdMediatheksLink":false,"showMediatheksLink":false,"showAirdate":false,"showProfileInfoAsByline":false,"obsolet_brandOfTeaser":"hessenschau","documentSection":"Gesellschaft","headlineTag":"h1","icon":"ortsmarke","imageVariant":"topteaser","shorttext":"Vor einem Jahr wurde die syrische Familie Kheder aus Wolfhagen abgeschoben. Die Gemeinde setzte alle Hebel in Bewegung, um Mutter, Tochter und Sohn zurückzuholen. Im Fall der Kinder hat das nun zu einem Happy End geführt. Doch ihre Mutter fehlt.","sophoraId":"rueckkehr-nach-abschiebung-wolfhagen--100","profiles":"Von Alf Haubitz und Alice Merton","teaserLead":{"avDocument":{"isVideo":true,"videoUrl":"https://hr-a.akamaihd.net/video/as/hs/2022_06/hrLogo_220614153555_sf14xtiktokpolizeidieckmannhauffheinneuneu_18520763_512x288-25p-500kbit.mp4","adaptiveStreamingUrl":"https://hr-vh.akamaihd.net/i/video/as/hs/2022_06/hrLogo_220614153555_sf14xtiktokpolizeidieckmannhauffheinneuneu_18520763_,480x270-50p-700kbit,512x288-25p-500kbit,640x360-50p-1200kbit,960x540-50p-1600kbit,1280x720-50p-3200kbit,1920x1080-50p-5000kbit,.mp4.csmil/master.m3u8","videoResolutionLevels":[{"url":"https://hr-a.akamaihd.net/video/as/hs/2022_06/hrLogo_220614153555_sf14xtiktokpolizeidieckmannhauffheinneuneu_18520763_480x270-50p-700kbit.mp4","verticalResolution":"270"},{"url":"https://hr-a.akamaihd.net/video/as/hs/2022_06/hrLogo_220614153555_sf14xtiktokpolizeidieckmannhauffheinneuneu_18520763_512x288-25p-500kbit.mp4","verticalResolution":"288"},{"url":"https://hr-a.akamaihd.net/video/as/hs/2022_06/hrLogo_220614153555_sf14xtiktokpolizeidieckmannhauffheinneuneu_18520763_640x360-50p-1200kbit.mp4","verticalResolution":"360"},{"url":"https://hr-a.akamaihd.net/video/as/hs/2022_06/hrLogo_220614153555_sf14xtiktokpolizeidieckmannhauffheinneuneu_18520763_960x540-50p-1600kbit.mp4","verticalResolution":"540"},{"url":"https://hr-a.akamaihd.net/video/as/hs/2022_06/hrLogo_220614153555_sf14xtiktokpolizeidieckmannhauffheinneuneu_18520763_1280x720-50p-3200kbit.mp4","verticalResolution":"720"},{"url":"https://hr-a.akamaihd.net/video/as/hs/2022_06/hrLogo_220614153555_sf14xtiktokpolizeidieckmannhauffheinneuneu_18520763_1920x1080-50p-5000kbit.mp4","verticalResolution":"1080"}],"videoSubtitleUrl":"","mediaMetadata":"{\"agf\":{\"title\":\"hr-fernsehen__VideozeigtrassistischeBeleidigungdurchPolizisten_14.06.202200:00\",\"livestream\":\"no\",\"type\":\"content\",\"airdate\":\"14.06.202200:00\",\"program\":\"hr-fernsehen\",\"assetid\":\"5f3912d337889c6c64e48879d80c562b\",\"uurl\":\"as/hs/2022_06/hrLogo_220614153555_sf14xtiktokpolizeidieckmannhauffheinneuneu_18520763_512x288-25p-500kbit.mp4\",\"nol_c2\":\"p2,Y\",\"nol_c5\":\"p5,hessenschau\",\"nol_c7\":\"p7,as/hs/2022_06/hrLogo_220614153555_sf14xtiktokpolizeidieckmannhauffheinneuneu_18520763_512x288-25p-500kbit.mp4\",\"nol_c8\":\"p8,19\",\"nol_c9\":\"p9,_VideozeigtrassistischeBeleidigungdurchPolizisten_14.06.202200:00\",\"nol_c10\":\"p10,hr-fernsehen\",\"nol_c12\":\"p12,Content\",\"nol_c18\":\"p18,N\",\"length\":\"19\",\"nol_c20\":\"p20,GFKLinkID\"},\"ati\":{\"pageName\":\"video_zeigt_rassistische_beleidigung_durch_polizisten_video\",\"secondLevelId\":\"4\",\"documentName\":\"video-170288\",\"documentType\":\"hr-nt:video\",\"documentDate\":\"202206141656\",\"chapter\":\"\",\"mediaLabel\":\"video_zeigt_rassistische_beleidigung_durch_polizisten_video\",\"mediaTheme1\":\"hessenschau\",\"mediaTheme2\":\"\",\"atiSiteId\":\"551104\",\"atiTrackingHost\":\"https://logs1406\"}}","providerKeyWithSublines":"","teaseritem":[{"url":{"16to9":"https://www.hessenschau.de/gesellschaft/polizei-video-100~_t-1655214179068_v-16to9.jpg","16to9_retina":"https://www.hessenschau.de/gesellschaft/polizei-video-100~_t-1655214179068_v-16to9__retina.jpg"}}]},"image":""},"geotag":[{"title":"Wolfhagen"}],"link":{"url":"/teaser1","webviewUrl":"/teaser1#webview","isTargetBlank":false,"hasIcon":false,"iconName":"iconName","readMoreText":{"readMoreScreenreader":"Zum Artikel","readMore":"mehr","readMoreLong":"read More Long"},"content":{"headlineTag":"h1","headingFontVariant":"serif","imageVariant":"topteaser","isFileDownload":false,"teaserImage":{"alttext":"Lorem ipsum","copyrightWithLinks":"","responsiveImage":{"asPicture":false,"asImage":true,"fallback":"https://picsum.photos/id/188/480/270","sources":[{"sizes":"(min-width: 1010px) 960px, 100vw","srcset":"https://picsum.photos/id/188/320/180 320w, https://picsum.photos/id/188/480/270 480w, https://picsum.photos/id/188/640/360 640w, https://picsum.photos/id/188/960/540 960w, https://picsum.photos/id/188/1920/1080 1920w"}]}},"teaserSize":"hero","teaserType":"standard-ds","title":"Abgeschobene Geschwister aus Syrien zurück in Wolfhagen","topline":"Überglücklich, aber ohne Mama","trackingData":{"secondLevelId":"2","pageName":"hessenschau"}}}}}}
@@ -0,0 +1 @@
1
+ {"isSsi":true,"logicItem":{"includePath":"components/teaser/teaser_standard","includeModel":{"byline":"Byline","title":"Abgeschobene Geschwister aus Syrien zurück in Wolfhagen","topline":"Überglücklich, aber ohne Mama","headingFontVariant":"serif","extendedTitle":"","teaserType":"standard","teaserSize":"50","teaserDate":{"htmlDateTime":"2022-04-17T19:30+0200","htmlDate":"20.02.1983","date":"17.04.22","dateSeparatorTime":"17.04.22, 19:30"},"teaserInfo":{"showTeaserInfo":true,"showTeaserInfoSection":true,"showTeaserInfoChannel":true,"showTeaserInfoAll":true,"showTeaserInfoDate":false,"showTeaserInfoDateTime":true,"showTeaserInfoProgramRef":true},"teaserImage":{"alttext":"Lorem ipsum","copyrightWithLinks":"","responsiveImage":{"asPicture":false,"asImage":true,"fallback":"https://picsum.photos/id/188/480/270","sources":[{"sizes":"(min-width: 1010px) 960px, 100vw","srcset":"https://picsum.photos/id/188/320/180 320w, https://picsum.photos/id/188/480/270 480w, https://picsum.photos/id/188/640/360 640w, https://picsum.photos/id/188/960/540 960w, https://picsum.photos/id/188/1920/1080 1920w"}]}},"hasMediaButtons":false,"dontLazyload":true,"isStandardTeaser":true,"isHeroTeaser":true,"isMediaTeaser":false,"isGuide":false,"isProgram":false,"isEvent":false,"isTicker":false,"isAudio":false,"isVideo":false,"isPodcastEpisode":false,"isExtOrBrandLink":false,"isAuthor":false,"copyright":"Copyright Text","audioAuthor":"Audio Author","hasStatus":false,"hasTeaserItem":true,"allowAVConsumption":"true","displayEpgInfos":false,"aspectRatio":"ar--teaserTop","hideGeotag":false,"hideEditableByline":true,"doTracking":true,"trackingForArdMediatheksLink":false,"showMediatheksLink":false,"showAirdate":false,"showProfileInfoAsByline":false,"obsolet_brandOfTeaser":"hessenschau","documentSection":"Gesellschaft","headlineTag":"h1","icon":"ortsmarke","imageVariant":"topteaser","shorttext":"Vor einem Jahr wurde die syrische Familie Kheder aus Wolfhagen abgeschoben. Die Gemeinde setzte alle Hebel in Bewegung, um Mutter, Tochter und Sohn zurückzuholen. Im Fall der Kinder hat das nun zu einem Happy End geführt. Doch ihre Mutter fehlt.","sophoraId":"rueckkehr-nach-abschiebung-wolfhagen--100","profiles":"Von Alf Haubitz und Alice Merton","teaserLead":{"avDocument":{"isVideo":true,"videoUrl":"https://hr-a.akamaihd.net/video/as/hs/2022_06/hrLogo_220614153555_sf14xtiktokpolizeidieckmannhauffheinneuneu_18520763_512x288-25p-500kbit.mp4","adaptiveStreamingUrl":"https://hr-vh.akamaihd.net/i/video/as/hs/2022_06/hrLogo_220614153555_sf14xtiktokpolizeidieckmannhauffheinneuneu_18520763_,480x270-50p-700kbit,512x288-25p-500kbit,640x360-50p-1200kbit,960x540-50p-1600kbit,1280x720-50p-3200kbit,1920x1080-50p-5000kbit,.mp4.csmil/master.m3u8","videoResolutionLevels":[{"url":"https://hr-a.akamaihd.net/video/as/hs/2022_06/hrLogo_220614153555_sf14xtiktokpolizeidieckmannhauffheinneuneu_18520763_480x270-50p-700kbit.mp4","verticalResolution":"270"},{"url":"https://hr-a.akamaihd.net/video/as/hs/2022_06/hrLogo_220614153555_sf14xtiktokpolizeidieckmannhauffheinneuneu_18520763_512x288-25p-500kbit.mp4","verticalResolution":"288"},{"url":"https://hr-a.akamaihd.net/video/as/hs/2022_06/hrLogo_220614153555_sf14xtiktokpolizeidieckmannhauffheinneuneu_18520763_640x360-50p-1200kbit.mp4","verticalResolution":"360"},{"url":"https://hr-a.akamaihd.net/video/as/hs/2022_06/hrLogo_220614153555_sf14xtiktokpolizeidieckmannhauffheinneuneu_18520763_960x540-50p-1600kbit.mp4","verticalResolution":"540"},{"url":"https://hr-a.akamaihd.net/video/as/hs/2022_06/hrLogo_220614153555_sf14xtiktokpolizeidieckmannhauffheinneuneu_18520763_1280x720-50p-3200kbit.mp4","verticalResolution":"720"},{"url":"https://hr-a.akamaihd.net/video/as/hs/2022_06/hrLogo_220614153555_sf14xtiktokpolizeidieckmannhauffheinneuneu_18520763_1920x1080-50p-5000kbit.mp4","verticalResolution":"1080"}],"videoSubtitleUrl":"","mediaMetadata":"{\"agf\":{\"title\":\"hr-fernsehen__VideozeigtrassistischeBeleidigungdurchPolizisten_14.06.202200:00\",\"livestream\":\"no\",\"type\":\"content\",\"airdate\":\"14.06.202200:00\",\"program\":\"hr-fernsehen\",\"assetid\":\"5f3912d337889c6c64e48879d80c562b\",\"uurl\":\"as/hs/2022_06/hrLogo_220614153555_sf14xtiktokpolizeidieckmannhauffheinneuneu_18520763_512x288-25p-500kbit.mp4\",\"nol_c2\":\"p2,Y\",\"nol_c5\":\"p5,hessenschau\",\"nol_c7\":\"p7,as/hs/2022_06/hrLogo_220614153555_sf14xtiktokpolizeidieckmannhauffheinneuneu_18520763_512x288-25p-500kbit.mp4\",\"nol_c8\":\"p8,19\",\"nol_c9\":\"p9,_VideozeigtrassistischeBeleidigungdurchPolizisten_14.06.202200:00\",\"nol_c10\":\"p10,hr-fernsehen\",\"nol_c12\":\"p12,Content\",\"nol_c18\":\"p18,N\",\"length\":\"19\",\"nol_c20\":\"p20,GFKLinkID\"},\"ati\":{\"pageName\":\"video_zeigt_rassistische_beleidigung_durch_polizisten_video\",\"secondLevelId\":\"4\",\"documentName\":\"video-170288\",\"documentType\":\"hr-nt:video\",\"documentDate\":\"202206141656\",\"chapter\":\"\",\"mediaLabel\":\"video_zeigt_rassistische_beleidigung_durch_polizisten_video\",\"mediaTheme1\":\"hessenschau\",\"mediaTheme2\":\"\",\"atiSiteId\":\"551104\",\"atiTrackingHost\":\"https://logs1406\"}}","providerKeyWithSublines":"","teaseritem":[{"url":{"16to9":"https://www.hessenschau.de/gesellschaft/polizei-video-100~_t-1655214179068_v-16to9.jpg","16to9_retina":"https://www.hessenschau.de/gesellschaft/polizei-video-100~_t-1655214179068_v-16to9__retina.jpg"}}]},"image":""},"geotag":[{"title":"Wolfhagen"}],"link":{"url":"/teaser1","webviewUrl":"/teaser1#webview","isTargetBlank":false,"hasIcon":false,"iconName":"iconName","readMoreText":{"readMoreScreenreader":"Zum Artikel","readMore":"mehr","readMoreLong":"read More Long"},"content":{"headlineTag":"h1","headingFontVariant":"serif","imageVariant":"topteaser","isFileDownload":false,"teaserImage":{"alttext":"Lorem ipsum","copyrightWithLinks":"","responsiveImage":{"asPicture":false,"asImage":true,"fallback":"https://picsum.photos/id/188/480/270","sources":[{"sizes":"(min-width: 1010px) 960px, 100vw","srcset":"https://picsum.photos/id/188/320/180 320w, https://picsum.photos/id/188/480/270 480w, https://picsum.photos/id/188/640/360 640w, https://picsum.photos/id/188/960/540 960w, https://picsum.photos/id/188/1920/1080 1920w"}]}},"teaserSize":"hero","teaserType":"standard","title":"Abgeschobene Geschwister aus Syrien zurück in Wolfhagen","topline":"Überglücklich, aber ohne Mama","trackingData":{"secondLevelId":"2","pageName":"hessenschau"}}}}}}
@@ -1,8 +1,21 @@
1
- <article class="col-span-12 flex gap-y-3 gap-x-4 {{inline-switch this.teaserSize '["25","33","50"]' '["px-5 md:px-0 md:col-span-3 flex-row md:flex-col","md:col-span-4 flex-col","md:col-span-6 flex-col","flex-col"]'}} ">
1
+ <article class="col-span-12 flex gap-y-3 gap-x-4 {{inline-switch this.teaserSize '["25","33","50"]' '["js-is1to1 px-5 md:px-0 md:col-span-3 md:flex-col","md:col-span-4 flex-col","md:col-span-6 flex-col","flex-col"]'}} "
2
+ x-data="{ videoStart: false }"
3
+ {{#switch this.teaserSize~}}
4
+ {{~#case "25"}}
5
+
6
+ :class="videoStart ? 'flex-col' : 'flex-row'"
7
+ {{/case~}}
8
+ {{~/switch~}}
9
+ >
2
10
  <figure class="relative {{inline-switch this.teaserSize '["25"]' '["basis-2/5 md:flex-full ar-1-1 md:ar-16-9", "ar-16-9"]'}} ">
3
11
  {{> components/teaser/components/teaser_lead }}
4
12
  </figure>
5
13
  <div class="{{inline-switch this.teaserSize '["25"]' '["basis-3/5 md:flex-full"]'}} ">
14
+ {{#switch this.teaserSize~}}
15
+ {{~#case "25"}}
16
+ <button x-show="videoStart" @click="videoStart = false; $dispatch('player_colosed')" class="md:hidden">Video schließen</button>
17
+ {{/case~}}
18
+ {{~/switch~}}
6
19
  <header class="md:px-0 {{inline-switch teaserSize '["25"]' '["","px-5"]'}}">
7
20
  {{#>components/base/link css="hover:text-toplineColor" doTracking=(if this.doTracking 'true') clickLabelPrefix1=this.teaserSize clickLabelPrefix2="headlineLink" }}
8
21
  {{> components/teaser/components/teaser_heading
@@ -2,6 +2,7 @@ import { ArgsTable, Meta, Story, Canvas, Preview } from '@storybook/addon-docs'
2
2
  import teaser from './teaser_standard.hbs'
3
3
 
4
4
  import teaser50av from './fixtures/teaser_standard_50_serif_av_consumption.json'
5
+ import teaser25av from './fixtures/teaser_standard_25_serif_av_consumption.json'
5
6
 
6
7
  <Meta
7
8
  title="Komponenten/Teaser/AV-Standard"
@@ -47,4 +48,7 @@ Ein toller Einleitungstext für unsere `Teaser` Komponente:
47
48
  <Story name="Standard 50% AV" args={teaser50av.logicItem.includeModel}>
48
49
  {Template.bind({})}
49
50
  </Story>
51
+ <Story name="Standard 25" args={teaser25av.logicItem.includeModel}>
52
+ {Template.bind({})}
53
+ </Story>
50
54
  </Preview>
@@ -1,5 +1,5 @@
1
- import { fireEvent, hr$, listen, loadScript } from 'hrQueryNew'
2
- import TrackingCookie from '../../externalService/trackingCookie.subfeature'
1
+ import { fireEvent, hr$, listen, loadScript } from 'hrQueryDs'
2
+ import TrackingCookie from 'components/externalService/trackingCookieDs.subfeature'
3
3
 
4
4
  const VideoLivestream = function (options, rootElement) {
5
5
  'use strict'
@@ -1,5 +1,5 @@
1
- import { fireEvent, hr$, listen, loadScript } from 'hrQueryNew'
2
- import TrackingCookie from '../externalService/trackingCookie.subfeature'
1
+ import { fireEvent, hr$, listen, loadScript } from 'hrQueryDs'
2
+ import TrackingCookie from 'components/externalService/trackingCookieDs.subfeature'
3
3
 
4
4
  const VideoOnDemandPlayer = function (options, rootElement) {
5
5
  'use strict'
@@ -28,8 +28,8 @@ console.log('VideoOnDemandPlayer');
28
28
  mediaCollection,
29
29
  mediaStreamArray = []
30
30
 
31
- console.log(skinPath);
32
- /* console.log(isAdaptiveStream);
31
+ /* console.log(skinPath);
32
+ console.log(isAdaptiveStream);
33
33
  console.log(basePlayerUrl);
34
34
  console.log(previewImageUrl);
35
35
  console.log(adaptiveStreamingUrl);
@@ -341,8 +341,14 @@ console.log('VideoOnDemandPlayer');
341
341
  player.pause()
342
342
  }
343
343
  })
344
+ // listen('hr:global:startVideo:'+playerId, function (event) {
345
+ // if (event.detail == 'ardplayer') {
346
+ // player.play()
347
+ // }
348
+ // })
349
+
344
350
  }
345
-
351
+
346
352
  if (trackingCookie.isTrackingAccepted('agf') && window.gfkConnector && agfMetadata) {
347
353
  gfkConnector.init(function (gfkLinkID) {
348
354
  agfMetadata.nol_c20 = 'p20,' + gfkLinkID
@@ -351,6 +357,15 @@ console.log('VideoOnDemandPlayer');
351
357
  } else {
352
358
  setupPlayer()
353
359
  }
360
+
361
+ return {
362
+ play: function() {
363
+ player.play()
364
+ },
365
+ pause: function() {
366
+ player.pause()
367
+ }
368
+ }
354
369
  }
355
370
 
356
371
  export default VideoOnDemandPlayer
@@ -1,5 +1,5 @@
1
1
  <div class="c-videoplayer">
2
- <div id="{{nextRandom}}" class="relative js-load" data-new-hr-mediaplayer-loader='{
2
+ <div x-show="videoStart" x-transition.duration.100ms id="{{nextRandom}}" class="js-load" data-new-hr-mediaplayer-loader-ds='{
3
3
  "type": "ondemand",
4
4
  "position": "{{if _isTeaser 'teaser' 'page'}}",
5
5
  "teaserSize" : "{{if ../../this.teasersize ../../this.teasersize '00' }}",
@@ -59,19 +59,26 @@
59
59
  <span class="js-geotag c-teaser__geotag" aria-hidden="true">{{this.[0].title~}}</span>
60
60
  {{/with~}}
61
61
  {{/unless}}
62
- {{#if _isTeaser}}
63
- {{#with _teaser}}
62
+
63
+ </div>
64
+
65
+ {{#if _isTeaser}}
66
+ <div class="relative" x-show="!videoStart" x-transition.duration.100ms>
67
+ {{#with _teaser}}
68
+
64
69
  {{~#if ../_isCopyText~}}
65
70
  {{~> 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 ~}}
66
71
  {{else}}
67
72
  {{#>components/base/link _cssClasses="c-teaser__mediaLink" _isAriaHidden=true
68
- _doTracking=(if this.doTracking 'true') _clickLabelPrefix1=this.realTeasersize
69
- _clickLabelPrefix2="mediaLink" }}
73
+ _doTracking=(if this.doTracking 'true') _clickLabelPrefix1=this.realTeasersize
74
+ _clickLabelPrefix2="mediaLink" }}
70
75
  {{~> 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 ~}}
71
76
  {{/components/base/link }}
72
77
  {{/if}}
73
- {{/with}}
74
- {{> components/button/button_round _isButton="true" _addClass="absolute bottom-0 right-0 my-4 mx-4 js-mediaplayer__button" _showIcon=true _icon="play" _addIconClass="w-6 h-6 inline" _label="Video"}}
75
- {{/if}}
76
- </div>
78
+
79
+ {{/with}}
80
+ {{> components/button/button_round _isButton="true" _addClass="absolute bottom-0 right-0 my-4 mx-4 js-mediaplayer__button" _showIcon=true _icon="play" _addIconClass="w-6 h-6 inline" _label="Video" _alpineClick="videoStart = !videoStart"}}
81
+ </div>
82
+ {{/if}}
83
+
77
84
  </div>