{"id":88,"date":"2026-10-28T17:41:16","date_gmt":"2026-10-28T16:41:16","guid":{"rendered":"https:\/\/wagenhofer.ch\/me\/videos\/"},"modified":"2026-10-28T17:41:16","modified_gmt":"2026-10-28T16:41:16","slug":"videos","status":"publish","type":"page","link":"https:\/\/wagenhofer.ch\/me\/videos\/","title":{"rendered":"Videos"},"content":{"rendered":"<div class=\"wv\" id=\"wv-1\">\n  <style>\n    .wv { --wv-accent: var(--global-palette1, #2b6cb0); --wv-text: var(--global-palette3, #1a202c); --wv-muted: var(--global-palette6, #718096);\n          --wv-card: var(--global-palette9, #fff); --wv-bg: var(--global-palette8, #f7fafc); --wv-border: var(--global-palette7, #edf2f7);\n          width: min(1100px, calc(100vw - 32px)); position: relative; left: 50%; transform: translateX(-50%); color: var(--wv-text); font-family: inherit; }\n    .wv-player { display: none; margin-bottom: 28px; background: var(--wv-card); border: 1px solid var(--wv-border); border-radius: 12px; overflow: hidden; box-shadow: 0 2px 10px rgba(0,0,0,.06); }\n    .wv-player.on { display: block; }\n    .wv-player video { width: 100%; max-height: 78vh; background: #000; display: block; }\n    .wv-pinfo { padding: 14px 18px 16px; }\n    .wv-ptitle { font-size: 1.4rem; font-weight: 600; margin: 0 0 2px; }\n    .wv-pmeta { color: var(--wv-muted); font-size: .9rem; }\n    .wv-pmeta a { color: var(--wv-accent); text-decoration: none; }\n    .wv-pdesc { margin-top: 8px; white-space: pre-line; }\n    .wv-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 18px; }\n    .wv-card { background: var(--wv-card); border: 2px solid var(--wv-border); border-radius: 12px; overflow: hidden; cursor: pointer; transition: box-shadow .15s, border-color .15s; }\n    .wv-card:hover, .wv-card.active { border-color: var(--wv-accent); box-shadow: 0 4px 14px rgba(0,0,0,.1); }\n    .wv-thumb { width: 100%; aspect-ratio: 16\/9; object-fit: cover; background: #000; display: block; pointer-events: none; }\n    .wv-cinfo { padding: 10px 14px 14px; }\n    .wv-cinfo b { display: block; font-size: 1.05rem; }\n    .wv-cinfo span { color: var(--wv-muted); font-size: .85rem; }\n  <\/style>\n  <section class=\"wv-player\">\n    <video controls playsinline preload=\"metadata\"><\/video>\n    <div class=\"wv-pinfo\"><div class=\"wv-ptitle\"><\/div><div class=\"wv-pmeta\"><\/div><div class=\"wv-pdesc\"><\/div><\/div>\n  <\/section>\n  <div class=\"wv-grid\"><\/div>\n  <script>\n  (function(){\n    var root = document.getElementById('wv-1'), list = [{\"id\":\"transviamala-2026\",\"title\":\"Transviamala 2026\",\"date\":\"2026\",\"desc\":\"Insta360\",\"src\":\"https:\/\/wagenhofer.ch\/videos\/transviamala-2026\/transviamala-2026-pre.mp4\",\"poster\":\"\",\"views\":7,\"pid\":90}];\n    var v = root.querySelector('video'), grid = root.querySelector('.wv-grid'), player = root.querySelector('.wv-player');\n    var restUrl = \"https:\\\/\\\/wagenhofer.ch\\\/me\\\/wp-json\\\/wv\\\/v1\\\/view\\\/\", VIEW_SECONDS = 30;\n    var current = null, watched = 0, lastT = null, counted = {};\n    function fmt(n) { return n.toLocaleString() + (n === 1 ? ' view' : ' views'); }\n    function renderViews(item) {\n      root.querySelectorAll('.wv-views[data-id=\"' + item.id + '\"]').forEach(function(e){ e.textContent = fmt(item.views); });\n    }\n    \/\/ count a view after VIEW_SECONDS of real playback (seeking forward does not add watch time)\n    v.addEventListener('timeupdate', function(){\n      if (!current || counted[current.id] || v.paused) { lastT = v.currentTime; return; }\n      var d = v.currentTime - lastT;\n      if (lastT !== null && d > 0 && d < 1.5) watched += d;\n      lastT = v.currentTime;\n      if (watched >= VIEW_SECONDS) {\n        counted[current.id] = true; var it = current;\n        fetch(restUrl + it.pid, {method: 'POST'}).then(function(r){ return r.json(); }).then(function(j){\n          if (j && typeof j.views === 'number') { it.views = j.views; renderViews(it); }\n        }).catch(function(){});\n      }\n    });\n    v.addEventListener('seeking', function(){ lastT = null; });\n    function play(item, auto) {\n      current = item; watched = 0; lastT = null;\n      v.src = item.src; v.poster = item.poster || '';\n      player.classList.add('on');\n      root.querySelector('.wv-ptitle').textContent = item.title;\n      var meta = root.querySelector('.wv-pmeta'); meta.textContent = '';\n      var vs = document.createElement('span'); vs.className = 'wv-views'; vs.dataset.id = item.id; meta.appendChild(vs);\n      meta.appendChild(document.createTextNode((item.date ? ' \u00b7 ' + item.date : '') + ' \u00b7 '));\n      var a = document.createElement('a'); a.href = item.src; a.download = ''; a.textContent = 'Download'; meta.appendChild(a);\n      renderViews(item);\n      root.querySelector('.wv-pdesc').textContent = item.desc || '';\n      root.querySelectorAll('.wv-card').forEach(function(c){ c.classList.toggle('active', c.dataset.id === item.id); });\n      history.replaceState(null, '', '?v=' + encodeURIComponent(item.id));\n      if (auto) { v.play().catch(function(){}); player.scrollIntoView({behavior:'smooth', block:'start'}); }\n    }\n    list.forEach(function(item){\n      var c = document.createElement('div'); c.className = 'wv-card'; c.dataset.id = item.id;\n      var t = item.poster ? document.createElement('img') : document.createElement('video');\n      t.className = 'wv-thumb';\n      if (item.poster) { t.src = item.poster; t.alt = ''; t.loading = 'lazy'; } else { t.preload = 'metadata'; t.muted = true; t.src = item.src + '#t=1'; }\n      var i = document.createElement('div'); i.className = 'wv-cinfo';\n      var b = document.createElement('b'); b.textContent = item.title; var s = document.createElement('span'); s.textContent = item.date ? item.date + ' \u00b7 ' : '';\n      var cv = document.createElement('span'); cv.className = 'wv-views'; cv.dataset.id = item.id; cv.textContent = fmt(item.views); s.appendChild(cv);\n      i.appendChild(b); i.appendChild(s); c.appendChild(t); c.appendChild(i);\n      c.onclick = function(){ play(item, true); }; grid.appendChild(c);\n    });\n    var sel = new URLSearchParams(location.search).get('v');\n    play(list.filter(function(i){ return i.id === sel; })[0] || list[0], false);\n  })();\n  <\/script>\n<\/div>\n    \n","protected":false},"excerpt":{"rendered":"","protected":false},"author":0,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"_kad_post_transparent":"","_kad_post_title":"","_kad_post_layout":"fullwidth","_kad_post_sidebar_id":"","_kad_post_content_style":"unboxed","_kad_post_vertical_padding":"","_kad_post_feature":"","_kad_post_feature_position":"","_kad_post_header":false,"_kad_post_footer":false,"_kad_post_classname":"","footnotes":""},"class_list":["post-88","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/wagenhofer.ch\/me\/wp-json\/wp\/v2\/pages\/88","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/wagenhofer.ch\/me\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/wagenhofer.ch\/me\/wp-json\/wp\/v2\/types\/page"}],"replies":[{"embeddable":true,"href":"https:\/\/wagenhofer.ch\/me\/wp-json\/wp\/v2\/comments?post=88"}],"version-history":[{"count":0,"href":"https:\/\/wagenhofer.ch\/me\/wp-json\/wp\/v2\/pages\/88\/revisions"}],"wp:attachment":[{"href":"https:\/\/wagenhofer.ch\/me\/wp-json\/wp\/v2\/media?parent=88"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}