|
| 1 | +<!DOCTYPE html> |
| 2 | +<html lang="en"> |
| 3 | +<head> |
| 4 | + <meta charset="utf-8"> |
| 5 | + <title>Cloudinary Video Player</title> |
| 6 | + <link href="https://res.cloudinary.com/cloudinary-marketing/image/upload/f_auto,q_auto/c_scale,w_32/v1597183771/creative_staging/cloudinary_internal/Website/Brand%20Updates/Favicon/cloudinary_web_favicon_192x192.png" rel="icon" type="image/png"> |
| 7 | + |
| 8 | + <!-- Bootstrap --> |
| 9 | + <link href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T" crossorigin="anonymous"> |
| 10 | + |
| 11 | + <!-- highlight.js --> |
| 12 | + <link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/highlight.js/9.12.0/styles/solarized-light.min.css"> |
| 13 | + <script src="//cdnjs.cloudflare.com/ajax/libs/highlight.js/9.12.0/highlight.min.js"></script> |
| 14 | + <script>hljs.initHighlightingOnLoad();</script> |
| 15 | + |
| 16 | + <!-- |
| 17 | + We're loading scripts & style dynamically for development/testing. |
| 18 | + Real-world usage would look like this: |
| 19 | +
|
| 20 | + <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/cloudinary-video-player/dist/cld-video-player.min.css"> |
| 21 | + <script src="https://cdn.jsdelivr.net/npm/cloudinary-video-player/dist/cld-video-player.min.js"></script> |
| 22 | + --> |
| 23 | + |
| 24 | + <script type="text/javascript" src="./scripts.js"></script> |
| 25 | + |
| 26 | + <script type="text/javascript"> |
| 27 | + var player; |
| 28 | + |
| 29 | + function loadSource(hdrEnabled) { |
| 30 | + player.source('video/examples/hdr', { hdr: hdrEnabled, info: { title: hdrEnabled ? 'HDR' : 'SDR' } }); |
| 31 | + } |
| 32 | + |
| 33 | + window.addEventListener('load', function(){ |
| 34 | + player = cloudinary.videoPlayer('player', { cloud_name: 'prod' }); |
| 35 | + loadSource(true); |
| 36 | + |
| 37 | + document.getElementById('hdr-toggle').addEventListener('change', function() { |
| 38 | + loadSource(this.checked); |
| 39 | + }); |
| 40 | + }, false); |
| 41 | + </script> |
| 42 | + |
| 43 | +</head> |
| 44 | +<body> |
| 45 | + <div class="container p-4 col-12 col-md-9 col-xl-6"> |
| 46 | + <nav class="nav mb-2"> |
| 47 | + <a href="./index.html"><< Back to examples index</a> |
| 48 | + </nav> |
| 49 | + <h1>Cloudinary Video Player</h1> |
| 50 | + <h3 class="mb-4">HDR</h3> |
| 51 | + |
| 52 | + <div class="form-check mb-2"> |
| 53 | + <input type="checkbox" class="form-check-input" id="hdr-toggle" checked> |
| 54 | + <label class="form-check-label" for="hdr-toggle">Enable HDR</label> |
| 55 | + </div> |
| 56 | + |
| 57 | + <video |
| 58 | + id="player" |
| 59 | + playsinline |
| 60 | + controls |
| 61 | + muted |
| 62 | + autoplay |
| 63 | + class="cld-video-player" |
| 64 | + width="500"> |
| 65 | + </video> |
| 66 | + |
| 67 | + <p class="mt-4"> |
| 68 | + <a href="https://cloudinary.com/documentation/cloudinary_video_player">Full documentation</a> |
| 69 | + </p> |
| 70 | + |
| 71 | + <h3 class="mt-4">Example Code:</h3> |
| 72 | + <pre> |
| 73 | + <code class="language-html"> |
| 74 | + <video |
| 75 | + id="player" |
| 76 | + playsinline |
| 77 | + controls |
| 78 | + muted |
| 79 | + autoplay |
| 80 | + class="cld-video-player" |
| 81 | + width="500"> |
| 82 | + </video> |
| 83 | + </code> |
| 84 | + <code class="language-javascript"> |
| 85 | + player = cloudinary.videoPlayer('player', { cloud_name: 'prod' }); |
| 86 | + player.source('video/examples/hdr', { hdr: true, info: { title: 'HDR' } }); |
| 87 | + </code> |
| 88 | + </pre> |
| 89 | + </div> |
| 90 | + |
| 91 | +</body> |
| 92 | +</html> |
0 commit comments