@mux/mux-player 0.1.0-beta.23 → 0.1.0-beta.26

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 (73) hide show
  1. package/CHANGELOG.md +36 -0
  2. package/README.md +38 -36
  3. package/coverage/lcov-report/index.html +31 -31
  4. package/coverage/lcov-report/src/dialog.ts.html +1 -1
  5. package/coverage/lcov-report/src/errors.ts.html +1 -1
  6. package/coverage/lcov-report/src/helpers.ts.html +30 -9
  7. package/coverage/lcov-report/src/html.ts.html +159 -9
  8. package/coverage/lcov-report/src/index.html +52 -52
  9. package/coverage/lcov-report/src/index.ts.html +156 -27
  10. package/coverage/lcov-report/src/logger.ts.html +1 -1
  11. package/coverage/lcov-report/src/media-chrome/dialog.ts.html +1 -1
  12. package/coverage/lcov-report/src/media-chrome/index.html +1 -1
  13. package/coverage/lcov-report/src/media-chrome/time-display.ts.html +1 -1
  14. package/coverage/lcov-report/src/media-theme-mux/icons/airplay.svg.html +1 -1
  15. package/coverage/lcov-report/src/media-theme-mux/icons/captions-off.svg.html +1 -1
  16. package/coverage/lcov-report/src/media-theme-mux/icons/captions-on.svg.html +1 -1
  17. package/coverage/lcov-report/src/media-theme-mux/icons/cast-enter.svg.html +103 -0
  18. package/coverage/lcov-report/src/media-theme-mux/icons/cast-exit.svg.html +106 -0
  19. package/coverage/lcov-report/src/media-theme-mux/icons/fullscreen-enter.svg.html +1 -1
  20. package/coverage/lcov-report/src/media-theme-mux/icons/fullscreen-exit.svg.html +1 -1
  21. package/coverage/lcov-report/src/media-theme-mux/icons/index.html +33 -3
  22. package/coverage/lcov-report/src/media-theme-mux/icons/pause.svg.html +1 -1
  23. package/coverage/lcov-report/src/media-theme-mux/icons/pip-enter.svg.html +1 -1
  24. package/coverage/lcov-report/src/media-theme-mux/icons/pip-exit.svg.html +1 -1
  25. package/coverage/lcov-report/src/media-theme-mux/icons/play.svg.html +1 -1
  26. package/coverage/lcov-report/src/media-theme-mux/icons/seek-backward.svg.html +1 -1
  27. package/coverage/lcov-report/src/media-theme-mux/icons/seek-forward.svg.html +1 -1
  28. package/coverage/lcov-report/src/media-theme-mux/icons/volume-high.svg.html +1 -1
  29. package/coverage/lcov-report/src/media-theme-mux/icons/volume-low.svg.html +1 -1
  30. package/coverage/lcov-report/src/media-theme-mux/icons/volume-medium.svg.html +1 -1
  31. package/coverage/lcov-report/src/media-theme-mux/icons/volume-off.svg.html +1 -1
  32. package/coverage/lcov-report/src/media-theme-mux/icons.ts.html +18 -6
  33. package/coverage/lcov-report/src/media-theme-mux/index.html +26 -26
  34. package/coverage/lcov-report/src/media-theme-mux/media-theme-mux.ts.html +342 -177
  35. package/coverage/lcov-report/src/media-theme-mux/styles.css.html +117 -18
  36. package/coverage/lcov-report/src/styles.css.html +1 -1
  37. package/coverage/lcov-report/src/template.ts.html +128 -65
  38. package/coverage/lcov-report/src/utils.ts.html +1 -1
  39. package/coverage/lcov-report/src/video-api.ts.html +91 -13
  40. package/coverage/lcov.info +1595 -1273
  41. package/dist/index.cjs.js +503 -343
  42. package/dist/index.mjs +296 -228
  43. package/dist/mux-player.js +556 -396
  44. package/dist/mux-player.mjs +556 -396
  45. package/dist/tsconfig.tsbuildinfo +1 -1
  46. package/dist/types/helpers.d.ts +1 -0
  47. package/dist/types/html.d.ts +5 -0
  48. package/dist/types/index.d.ts +5 -3
  49. package/dist/types/media-theme-mux/icons.d.ts +2 -0
  50. package/dist/types/media-theme-mux/media-theme-mux.d.ts +32 -12
  51. package/dist/types/template.d.ts +0 -1
  52. package/dist/types/video-api.d.ts +4 -0
  53. package/dist/types-ts3.4/helpers.d.ts +1 -0
  54. package/dist/types-ts3.4/html.d.ts +5 -0
  55. package/dist/types-ts3.4/index.d.ts +4 -3
  56. package/dist/types-ts3.4/media-theme-mux/icons.d.ts +2 -0
  57. package/dist/types-ts3.4/media-theme-mux/media-theme-mux.d.ts +32 -12
  58. package/dist/types-ts3.4/template.d.ts +0 -1
  59. package/dist/types-ts3.4/video-api.d.ts +2 -0
  60. package/package.json +5 -5
  61. package/src/helpers.ts +7 -0
  62. package/src/html.ts +50 -0
  63. package/src/index.ts +58 -15
  64. package/src/media-theme-mux/icons/cast-enter.svg +6 -0
  65. package/src/media-theme-mux/icons/cast-exit.svg +7 -0
  66. package/src/media-theme-mux/icons.ts +4 -0
  67. package/src/media-theme-mux/media-theme-mux.ts +179 -124
  68. package/src/media-theme-mux/styles.css +47 -14
  69. package/src/template.ts +78 -57
  70. package/src/types.d.ts +3 -0
  71. package/src/video-api.ts +27 -1
  72. package/test/player.test.js +34 -0
  73. package/test/template.test.js +6 -4
@@ -1 +1 @@
1
- {"program":{"fileNames":["../../../node_modules/typescript/lib/lib.es5.d.ts","../../../node_modules/typescript/lib/lib.es2015.d.ts","../../../node_modules/typescript/lib/lib.es2016.d.ts","../../../node_modules/typescript/lib/lib.es2017.d.ts","../../../node_modules/typescript/lib/lib.es2018.d.ts","../../../node_modules/typescript/lib/lib.es2019.d.ts","../../../node_modules/typescript/lib/lib.dom.d.ts","../../../node_modules/typescript/lib/lib.dom.iterable.d.ts","../../../node_modules/typescript/lib/lib.webworker.importscripts.d.ts","../../../node_modules/typescript/lib/lib.scripthost.d.ts","../../../node_modules/typescript/lib/lib.es2015.core.d.ts","../../../node_modules/typescript/lib/lib.es2015.collection.d.ts","../../../node_modules/typescript/lib/lib.es2015.generator.d.ts","../../../node_modules/typescript/lib/lib.es2015.iterable.d.ts","../../../node_modules/typescript/lib/lib.es2015.promise.d.ts","../../../node_modules/typescript/lib/lib.es2015.proxy.d.ts","../../../node_modules/typescript/lib/lib.es2015.reflect.d.ts","../../../node_modules/typescript/lib/lib.es2015.symbol.d.ts","../../../node_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts","../../../node_modules/typescript/lib/lib.es2016.array.include.d.ts","../../../node_modules/typescript/lib/lib.es2017.object.d.ts","../../../node_modules/typescript/lib/lib.es2017.sharedmemory.d.ts","../../../node_modules/typescript/lib/lib.es2017.string.d.ts","../../../node_modules/typescript/lib/lib.es2017.intl.d.ts","../../../node_modules/typescript/lib/lib.es2017.typedarrays.d.ts","../../../node_modules/typescript/lib/lib.es2018.asyncgenerator.d.ts","../../../node_modules/typescript/lib/lib.es2018.asynciterable.d.ts","../../../node_modules/typescript/lib/lib.es2018.intl.d.ts","../../../node_modules/typescript/lib/lib.es2018.promise.d.ts","../../../node_modules/typescript/lib/lib.es2018.regexp.d.ts","../../../node_modules/typescript/lib/lib.es2019.array.d.ts","../../../node_modules/typescript/lib/lib.es2019.object.d.ts","../../../node_modules/typescript/lib/lib.es2019.string.d.ts","../../../node_modules/typescript/lib/lib.es2019.symbol.d.ts","../../../node_modules/typescript/lib/lib.es2019.full.d.ts","../src/media-chrome/dialog.ts","../src/dialog.ts","../../../node_modules/hls.js/dist/hls.js.d.ts","../../playback-core/dist/types/autoplay.d.ts","../../playback-core/dist/types/errors.d.ts","../../playback-core/dist/types/index.d.ts","../../mux-video/dist/types/CustomVideoElement.d.ts","../../mux-video/dist/types/index.d.ts","../src/utils.ts","../src/types.d.ts","../src/errors.ts","../../../node_modules/@github/template-parts/lib/types.d.ts","../../../node_modules/@github/template-parts/lib/template-instance.d.ts","../../../node_modules/@github/template-parts/lib/template-string-parser.d.ts","../../../node_modules/@github/template-parts/lib/attribute-template-part.d.ts","../../../node_modules/@github/template-parts/lib/node-template-part.d.ts","../../../node_modules/@github/template-parts/lib/processors.d.ts","../../../node_modules/@github/template-parts/lib/index.d.ts","../src/html.ts","../src/media-chrome/time-display.ts","../src/media-theme-mux/icons.ts","../src/media-theme-mux/media-theme-mux.ts","../src/logger.ts","../src/video-api.ts","../src/template.ts","../src/index.ts","../src/helpers.ts","../../../types/mux-embed.d.ts","../../../types/mux.d.ts"],"fileInfos":[{"version":"3ac1b83264055b28c0165688fda6dfcc39001e9e7828f649299101c23ad0a0c3","affectsGlobalScope":true},"dc47c4fa66b9b9890cf076304de2a9c5201e94b740cffdf09f87296d877d71f6","7a387c58583dfca701b6c85e0adaf43fb17d590fb16d5b2dc0a2fbd89f35c467","8a12173c586e95f4433e0c6dc446bc88346be73ffe9ca6eec7aa63c8f3dca7f9","5f4e733ced4e129482ae2186aae29fde948ab7182844c3a5a51dd346182c7b06","e6b724280c694a9f588847f754198fb96c43d805f065c3a5b28bbc9594541c84",{"version":"72704b10d97777e15f1a581b73f88273037ef752d2e50b72287bd0a90af64fe6","affectsGlobalScope":true},{"version":"dbb73d4d99be496175cb432c74c2615f78c76f4272f1d83cba11ee0ed6dbddf0","affectsGlobalScope":true},{"version":"7fac8cb5fc820bc2a59ae11ef1c5b38d3832c6d0dfaec5acdb5569137d09a481","affectsGlobalScope":true},{"version":"097a57355ded99c68e6df1b738990448e0bf170e606707df5a7c0481ff2427cd","affectsGlobalScope":true},{"version":"d8996609230d17e90484a2dd58f22668f9a05a3bfe00bfb1d6271171e54a31fb","affectsGlobalScope":true},{"version":"43fb1d932e4966a39a41b464a12a81899d9ae5f2c829063f5571b6b87e6d2f9c","affectsGlobalScope":true},{"version":"cdccba9a388c2ee3fd6ad4018c640a471a6c060e96f1232062223063b0a5ac6a","affectsGlobalScope":true},{"version":"c5c05907c02476e4bde6b7e76a79ffcd948aedd14b6a8f56e4674221b0417398","affectsGlobalScope":true},{"version":"0d5f52b3174bee6edb81260ebcd792692c32c81fd55499d69531496f3f2b25e7","affectsGlobalScope":true},{"version":"810627a82ac06fb5166da5ada4159c4ec11978dfbb0805fe804c86406dab8357","affectsGlobalScope":true},{"version":"62d80405c46c3f4c527ee657ae9d43fda65a0bf582292429aea1e69144a522a6","affectsGlobalScope":true},{"version":"3013574108c36fd3aaca79764002b3717da09725a36a6fc02eac386593110f93","affectsGlobalScope":true},{"version":"75ec0bdd727d887f1b79ed6619412ea72ba3c81d92d0787ccb64bab18d261f14","affectsGlobalScope":true},{"version":"3be5a1453daa63e031d266bf342f3943603873d890ab8b9ada95e22389389006","affectsGlobalScope":true},{"version":"17bb1fc99591b00515502d264fa55dc8370c45c5298f4a5c2083557dccba5a2a","affectsGlobalScope":true},{"version":"7ce9f0bde3307ca1f944119f6365f2d776d281a393b576a18a2f2893a2d75c98","affectsGlobalScope":true},{"version":"6a6b173e739a6a99629a8594bfb294cc7329bfb7b227f12e1f7c11bc163b8577","affectsGlobalScope":true},{"version":"12a310447c5d23c7d0d5ca2af606e3bd08afda69100166730ab92c62999ebb9d","affectsGlobalScope":true},{"version":"b0124885ef82641903d232172577f2ceb5d3e60aed4da1153bab4221e1f6dd4e","affectsGlobalScope":true},{"version":"0eb85d6c590b0d577919a79e0084fa1744c1beba6fd0d4e951432fa1ede5510a","affectsGlobalScope":true},{"version":"da233fc1c8a377ba9e0bed690a73c290d843c2c3d23a7bd7ec5cd3d7d73ba1e0","affectsGlobalScope":true},{"version":"d154ea5bb7f7f9001ed9153e876b2d5b8f5c2bb9ec02b3ae0d239ec769f1f2ae","affectsGlobalScope":true},{"version":"bb2d3fb05a1d2ffbca947cc7cbc95d23e1d053d6595391bd325deb265a18d36c","affectsGlobalScope":true},{"version":"c80df75850fea5caa2afe43b9949338ce4e2de086f91713e9af1a06f973872b8","affectsGlobalScope":true},{"version":"9d57b2b5d15838ed094aa9ff1299eecef40b190722eb619bac4616657a05f951","affectsGlobalScope":true},{"version":"6c51b5dd26a2c31dbf37f00cfc32b2aa6a92e19c995aefb5b97a3a64f1ac99de","affectsGlobalScope":true},{"version":"6e7997ef61de3132e4d4b2250e75343f487903ddf5370e7ce33cf1b9db9a63ed","affectsGlobalScope":true},{"version":"2ad234885a4240522efccd77de6c7d99eecf9b4de0914adb9a35c0c22433f993","affectsGlobalScope":true},"1f03b495671c3a1bd24510f38b8947f0991dfd6bf0278c68eca14af15b306e1f","7e08426eb45c7c4a31fe409daf429a67dac33174ef413f1fcb2346b61a6da291","f3feb7da2b5509e262e56d65698358456e5760a0e270a41ad11793bfb69fd8e1","ece0cccc693a3364f05f68d7feb4d472e05b9f2eaea80f19fc10b17a0a6aa14d","e19277f843527448cadd35fd674e358d0d2a7f261e9631026ecc82feb85ecec8","8b1a6692156440f6585937b6b8de1c2692e7cac5c43aeb8893bfbd293f719552","eb22b463efe9cdd4c0852f62cf92ca3dfa59b136d82e28b7473b67105d19c780","6b8ca5a4e0a75f6c8e48c0fc2ff204502f780db438b3d56d07d5c8b5da2da9c2",{"version":"35a3049e63a6c25a98834a50fad77e7879dfed1eedd1fa77924006ef93e6fecb","affectsGlobalScope":true},"9e56cc4a629d54c40657b20d5ee01ebb1ced2982ef57a7781cb0411caccc05b0","b6a4de335345d33766e1415e30dcb3d43db101b909639bdabd7ec9a918156014","189efc6e09cd74946b1aa31e4e11cd9efea53313572311b2b588e30c59386efc","be4924b84f3f22834fe05e2cc0355be39759d318451137345697b64c9a1bcc5c","5c987a8e29048c496e003c908afd887f777729d7e89101f185076dcc711f5425","eed0609c3c7354c007bc6c5cf475f4c926e0e42a1d8f3c20315a59b08a096003","3c0fb83cadbbf57972e17794100705f40db3fde5e8527230f2f62bfe54ffaed3","226ae3ab8f056ee36204777b5c708d3638ca821f916edeab554b0a4d864382c2","c5fad06768578f22d8bb78e7ecbeebf5ad4ead6d3918493a84ee84a70eb59703","d86614ca2ee667ee898911e2c45e68f74562a3d59b332ca9295e1f054e1a3591","b30fd1fed49948b9188a855bf058f31c7f93146187666d63120ab31f4e290e03","b1f201bb669b96e00ebc5be8cf243bce47c82c48e60da6ae7c1c826442fa4e55","0e6e9e6a5bd19d35ed6347db8f1392ff9079cfdcd960ac7ec5fcde2fecfb212e","d5fd0db5e91ab69a90fc2952c2b4a0d3d5cd85a036261cd7e0807aac54b71d3d","9b767b6c40d380d0d8f17807042f8f16ab950bd0d0c57ebec712b497e47c22a6","7360cc475c9db8f0c97c1b73bea9d15715a8bd0916b67491d96980690010af95","a608e1bfce8b56ce5546d06b6f67c0a17be9866b6038d2989a2f1f13db91b86d","4182ea20d4d8a4ba8e614e3a65c026d36ce17b852fbc3f2d5c6cae68b16fb00b","d586a6480498831b5ff228911cac2d0b0fbb7aca2757fe8f8e4bffa949c32094","c5a4764697efe3b6b4eaf19b3dc1880cf3df665d30ec93e212233c29a2fa7207",{"version":"ee8e401f800f3d48020eda76c4fd27afd5bab992195252939329ae56dc9d1889","affectsGlobalScope":true}],"options":{"composite":true,"declaration":true,"emitDeclarationOnly":true,"esModuleInterop":true,"module":5,"noImplicitAny":true,"outDir":"./types","rootDir":"../src","skipLibCheck":true,"sourceMap":true,"strict":true,"target":6},"fileIdsList":[[47],[47,48,49,50,51,52],[48],[36],[43,44,45],[41,44,61],[53],[41,43,44,45,46,54,57,58,59,60,62],[44,45,62],[54],[41,54,55,56],[37,41,44,45,54,57,62],[43],[43,58],[42],[38,41,42],[38],[38,39,40,63]],"referencedMap":[[50,1],[53,2],[51,1],[52,1],[48,1],[47,3],[37,4],[46,5],[62,6],[54,7],[61,8],[58,9],[56,10],[57,11],[60,12],[45,13],[59,14],[42,15],[43,16],[39,17],[41,18],[64,17]],"exportedModulesMap":[[50,1],[53,2],[51,1],[52,1],[48,1],[47,3],[37,4],[46,5],[62,6],[54,7],[61,8],[58,9],[56,10],[57,11],[60,12],[45,13],[59,14],[42,15],[43,16],[39,17],[41,18],[64,17]],"semanticDiagnosticsPerFile":[50,53,51,52,48,49,47,38,7,8,12,11,2,13,14,15,16,17,18,19,20,3,4,24,21,22,23,25,26,27,5,28,29,30,31,6,35,32,33,34,1,10,9,37,46,62,54,61,58,36,55,56,57,60,45,44,59,42,43,39,40,41,63,64]},"version":"4.6.4"}
1
+ {"program":{"fileNames":["../../../node_modules/typescript/lib/lib.es5.d.ts","../../../node_modules/typescript/lib/lib.es2015.d.ts","../../../node_modules/typescript/lib/lib.es2016.d.ts","../../../node_modules/typescript/lib/lib.es2017.d.ts","../../../node_modules/typescript/lib/lib.es2018.d.ts","../../../node_modules/typescript/lib/lib.es2019.d.ts","../../../node_modules/typescript/lib/lib.dom.d.ts","../../../node_modules/typescript/lib/lib.dom.iterable.d.ts","../../../node_modules/typescript/lib/lib.webworker.importscripts.d.ts","../../../node_modules/typescript/lib/lib.scripthost.d.ts","../../../node_modules/typescript/lib/lib.es2015.core.d.ts","../../../node_modules/typescript/lib/lib.es2015.collection.d.ts","../../../node_modules/typescript/lib/lib.es2015.generator.d.ts","../../../node_modules/typescript/lib/lib.es2015.iterable.d.ts","../../../node_modules/typescript/lib/lib.es2015.promise.d.ts","../../../node_modules/typescript/lib/lib.es2015.proxy.d.ts","../../../node_modules/typescript/lib/lib.es2015.reflect.d.ts","../../../node_modules/typescript/lib/lib.es2015.symbol.d.ts","../../../node_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts","../../../node_modules/typescript/lib/lib.es2016.array.include.d.ts","../../../node_modules/typescript/lib/lib.es2017.object.d.ts","../../../node_modules/typescript/lib/lib.es2017.sharedmemory.d.ts","../../../node_modules/typescript/lib/lib.es2017.string.d.ts","../../../node_modules/typescript/lib/lib.es2017.intl.d.ts","../../../node_modules/typescript/lib/lib.es2017.typedarrays.d.ts","../../../node_modules/typescript/lib/lib.es2018.asyncgenerator.d.ts","../../../node_modules/typescript/lib/lib.es2018.asynciterable.d.ts","../../../node_modules/typescript/lib/lib.es2018.intl.d.ts","../../../node_modules/typescript/lib/lib.es2018.promise.d.ts","../../../node_modules/typescript/lib/lib.es2018.regexp.d.ts","../../../node_modules/typescript/lib/lib.es2019.array.d.ts","../../../node_modules/typescript/lib/lib.es2019.object.d.ts","../../../node_modules/typescript/lib/lib.es2019.string.d.ts","../../../node_modules/typescript/lib/lib.es2019.symbol.d.ts","../../../node_modules/typescript/lib/lib.es2019.full.d.ts","../src/media-chrome/dialog.ts","../src/dialog.ts","../../../node_modules/hls.js/dist/hls.js.d.ts","../../playback-core/dist/types/autoplay.d.ts","../../playback-core/dist/types/errors.d.ts","../../playback-core/dist/types/tracks.d.ts","../../playback-core/dist/types/index.d.ts","../../mux-video/dist/types/CustomVideoElement.d.ts","../../mux-video/dist/types/index.d.ts","../src/utils.ts","../src/types.d.ts","../src/errors.ts","../src/logger.ts","../src/video-api.ts","../../../node_modules/@github/template-parts/lib/types.d.ts","../../../node_modules/@github/template-parts/lib/template-instance.d.ts","../../../node_modules/@github/template-parts/lib/template-string-parser.d.ts","../../../node_modules/@github/template-parts/lib/attribute-template-part.d.ts","../../../node_modules/@github/template-parts/lib/node-template-part.d.ts","../../../node_modules/@github/template-parts/lib/processors.d.ts","../../../node_modules/@github/template-parts/lib/index.d.ts","../src/html.ts","../src/media-chrome/time-display.ts","../src/media-theme-mux/icons.ts","../src/media-theme-mux/media-theme-mux.ts","../src/template.ts","../src/index.ts","../src/helpers.ts","../../../types/media-chrome.d.ts","../../../types/mux-embed.d.ts","../../../types/mux.d.ts"],"fileInfos":[{"version":"3ac1b83264055b28c0165688fda6dfcc39001e9e7828f649299101c23ad0a0c3","affectsGlobalScope":true},"dc47c4fa66b9b9890cf076304de2a9c5201e94b740cffdf09f87296d877d71f6","7a387c58583dfca701b6c85e0adaf43fb17d590fb16d5b2dc0a2fbd89f35c467","8a12173c586e95f4433e0c6dc446bc88346be73ffe9ca6eec7aa63c8f3dca7f9","5f4e733ced4e129482ae2186aae29fde948ab7182844c3a5a51dd346182c7b06","e6b724280c694a9f588847f754198fb96c43d805f065c3a5b28bbc9594541c84",{"version":"72704b10d97777e15f1a581b73f88273037ef752d2e50b72287bd0a90af64fe6","affectsGlobalScope":true},{"version":"dbb73d4d99be496175cb432c74c2615f78c76f4272f1d83cba11ee0ed6dbddf0","affectsGlobalScope":true},{"version":"7fac8cb5fc820bc2a59ae11ef1c5b38d3832c6d0dfaec5acdb5569137d09a481","affectsGlobalScope":true},{"version":"097a57355ded99c68e6df1b738990448e0bf170e606707df5a7c0481ff2427cd","affectsGlobalScope":true},{"version":"d8996609230d17e90484a2dd58f22668f9a05a3bfe00bfb1d6271171e54a31fb","affectsGlobalScope":true},{"version":"43fb1d932e4966a39a41b464a12a81899d9ae5f2c829063f5571b6b87e6d2f9c","affectsGlobalScope":true},{"version":"cdccba9a388c2ee3fd6ad4018c640a471a6c060e96f1232062223063b0a5ac6a","affectsGlobalScope":true},{"version":"c5c05907c02476e4bde6b7e76a79ffcd948aedd14b6a8f56e4674221b0417398","affectsGlobalScope":true},{"version":"0d5f52b3174bee6edb81260ebcd792692c32c81fd55499d69531496f3f2b25e7","affectsGlobalScope":true},{"version":"810627a82ac06fb5166da5ada4159c4ec11978dfbb0805fe804c86406dab8357","affectsGlobalScope":true},{"version":"62d80405c46c3f4c527ee657ae9d43fda65a0bf582292429aea1e69144a522a6","affectsGlobalScope":true},{"version":"3013574108c36fd3aaca79764002b3717da09725a36a6fc02eac386593110f93","affectsGlobalScope":true},{"version":"75ec0bdd727d887f1b79ed6619412ea72ba3c81d92d0787ccb64bab18d261f14","affectsGlobalScope":true},{"version":"3be5a1453daa63e031d266bf342f3943603873d890ab8b9ada95e22389389006","affectsGlobalScope":true},{"version":"17bb1fc99591b00515502d264fa55dc8370c45c5298f4a5c2083557dccba5a2a","affectsGlobalScope":true},{"version":"7ce9f0bde3307ca1f944119f6365f2d776d281a393b576a18a2f2893a2d75c98","affectsGlobalScope":true},{"version":"6a6b173e739a6a99629a8594bfb294cc7329bfb7b227f12e1f7c11bc163b8577","affectsGlobalScope":true},{"version":"12a310447c5d23c7d0d5ca2af606e3bd08afda69100166730ab92c62999ebb9d","affectsGlobalScope":true},{"version":"b0124885ef82641903d232172577f2ceb5d3e60aed4da1153bab4221e1f6dd4e","affectsGlobalScope":true},{"version":"0eb85d6c590b0d577919a79e0084fa1744c1beba6fd0d4e951432fa1ede5510a","affectsGlobalScope":true},{"version":"da233fc1c8a377ba9e0bed690a73c290d843c2c3d23a7bd7ec5cd3d7d73ba1e0","affectsGlobalScope":true},{"version":"d154ea5bb7f7f9001ed9153e876b2d5b8f5c2bb9ec02b3ae0d239ec769f1f2ae","affectsGlobalScope":true},{"version":"bb2d3fb05a1d2ffbca947cc7cbc95d23e1d053d6595391bd325deb265a18d36c","affectsGlobalScope":true},{"version":"c80df75850fea5caa2afe43b9949338ce4e2de086f91713e9af1a06f973872b8","affectsGlobalScope":true},{"version":"9d57b2b5d15838ed094aa9ff1299eecef40b190722eb619bac4616657a05f951","affectsGlobalScope":true},{"version":"6c51b5dd26a2c31dbf37f00cfc32b2aa6a92e19c995aefb5b97a3a64f1ac99de","affectsGlobalScope":true},{"version":"6e7997ef61de3132e4d4b2250e75343f487903ddf5370e7ce33cf1b9db9a63ed","affectsGlobalScope":true},{"version":"2ad234885a4240522efccd77de6c7d99eecf9b4de0914adb9a35c0c22433f993","affectsGlobalScope":true},"1f03b495671c3a1bd24510f38b8947f0991dfd6bf0278c68eca14af15b306e1f","7e08426eb45c7c4a31fe409daf429a67dac33174ef413f1fcb2346b61a6da291","f3feb7da2b5509e262e56d65698358456e5760a0e270a41ad11793bfb69fd8e1","ece0cccc693a3364f05f68d7feb4d472e05b9f2eaea80f19fc10b17a0a6aa14d","e19277f843527448cadd35fd674e358d0d2a7f261e9631026ecc82feb85ecec8","8b1a6692156440f6585937b6b8de1c2692e7cac5c43aeb8893bfbd293f719552","16d89c2619e5c73fe784212aa78a4c3f6581d54e5bb566a942dfd4598c974370","6e7872c5ff282b768873500c6b800914f375037e346a733df49e544b084ef7cc","6b8ca5a4e0a75f6c8e48c0fc2ff204502f780db438b3d56d07d5c8b5da2da9c2",{"version":"35a3049e63a6c25a98834a50fad77e7879dfed1eedd1fa77924006ef93e6fecb","affectsGlobalScope":true},"9e56cc4a629d54c40657b20d5ee01ebb1ced2982ef57a7781cb0411caccc05b0","8eae9e06de575fb2d527f879afbc9db6d2d133bc042c91bbf8742a3aab1d88d8","189efc6e09cd74946b1aa31e4e11cd9efea53313572311b2b588e30c59386efc","9b767b6c40d380d0d8f17807042f8f16ab950bd0d0c57ebec712b497e47c22a6","cc46f11b1c564e85f04320dfa6511dfc37de2026443e50002754366d6b172756","be4924b84f3f22834fe05e2cc0355be39759d318451137345697b64c9a1bcc5c","5c987a8e29048c496e003c908afd887f777729d7e89101f185076dcc711f5425","eed0609c3c7354c007bc6c5cf475f4c926e0e42a1d8f3c20315a59b08a096003","3c0fb83cadbbf57972e17794100705f40db3fde5e8527230f2f62bfe54ffaed3","226ae3ab8f056ee36204777b5c708d3638ca821f916edeab554b0a4d864382c2","c5fad06768578f22d8bb78e7ecbeebf5ad4ead6d3918493a84ee84a70eb59703","d86614ca2ee667ee898911e2c45e68f74562a3d59b332ca9295e1f054e1a3591","8eed08ca91f5609e00b92a5258218c65aa4968a70a7d6fd8dff61da4ab66793c","b1f201bb669b96e00ebc5be8cf243bce47c82c48e60da6ae7c1c826442fa4e55","5acd72ab38322e71f5a676d1d8e0ca01c44dfefaff33eb48bafffdf9465ff7c8","777633ba7cbdb47c95081f3c90251373ea1b943dae1c225a3a356523a7e3f9ed","18f8c2f1467e11b370baf09a5009fa31b6b8c562aa65c1c65b37f6e6a51a968a","f12c8316d41ebc9b84c53cacd17f40d3836b5635efd243a5158576935c17efc0","65dc194d6c7f4cf43984722d2f31ddcbb812738028300445c5ab38161ab0ce5d","3cf4c7825a6c0ef1965e8906b85844aafdcdda9d95c8b4bcfcb3a20811cfd0b1","c5a4764697efe3b6b4eaf19b3dc1880cf3df665d30ec93e212233c29a2fa7207",{"version":"ee8e401f800f3d48020eda76c4fd27afd5bab992195252939329ae56dc9d1889","affectsGlobalScope":true}],"options":{"composite":true,"declaration":true,"emitDeclarationOnly":true,"esModuleInterop":true,"module":5,"noImplicitAny":true,"outDir":"./types","rootDir":"../src","skipLibCheck":true,"sourceMap":true,"strict":true,"target":6},"fileIdsList":[[50],[50,51,52,53,54,55],[51],[36],[44,45,46],[42,45,62],[56],[42,44,45,46,47,48,49,57,61,63,64],[45,46,63],[57],[42,57,58,59,64],[37,42,45,46,57,60,63],[44],[44,45,48],[43],[38,42,43],[38],[38,39,40,41,65]],"referencedMap":[[53,1],[56,2],[54,1],[55,1],[51,1],[50,3],[37,4],[47,5],[63,6],[57,7],[62,8],[48,9],[59,10],[60,11],[61,12],[46,13],[49,14],[43,15],[44,16],[39,17],[42,18],[41,17],[66,17]],"exportedModulesMap":[[53,1],[56,2],[54,1],[55,1],[51,1],[50,3],[37,4],[47,5],[63,6],[57,7],[62,8],[48,9],[59,10],[60,11],[61,12],[46,13],[49,14],[43,15],[44,16],[39,17],[42,18],[41,17],[66,17]],"semanticDiagnosticsPerFile":[53,56,54,55,51,52,50,38,7,8,12,11,2,13,14,15,16,17,18,19,20,3,4,24,21,22,23,25,26,27,5,28,29,30,31,6,35,32,33,34,1,10,9,37,47,63,57,62,48,36,58,59,60,61,46,45,49,43,44,39,40,42,41,64,65,66]},"version":"4.6.4"}
@@ -13,6 +13,7 @@ export declare const getStoryboardURLFromPlaybackId: (playbackId?: string | unde
13
13
  token?: string | undefined;
14
14
  domain?: string | undefined;
15
15
  }) => string;
16
+ export declare function castThemeName(themeName?: string): string | undefined;
16
17
  export declare function toPropName(attrName: string): string;
17
18
  export declare const getLiveTime: (el: MuxPlayerElement) => number | undefined;
18
19
  export declare const seekToLive: (el: MuxPlayerElement) => void;
@@ -16,3 +16,8 @@ export declare class TemplateResult {
16
16
  export declare function html(strings: TemplateStringsArray, ...values: unknown[]): TemplateResult;
17
17
  export declare function render(result: TemplateResult, element: Node | NodeTemplatePart): void;
18
18
  export declare function createTemplateInstance(content: string, props?: any): TemplateInstance;
19
+ export declare const unsafeStatic: (...values: any[]) => {
20
+ $static$: (TemplateResult | {
21
+ strings: any[];
22
+ })[];
23
+ };
@@ -9,9 +9,6 @@ export declare type Tokens = {
9
9
  thumbnail?: string;
10
10
  storyboard?: string;
11
11
  };
12
- declare type MediaController = Element & {
13
- media: HTMLVideoElement;
14
- };
15
12
  declare class MuxPlayerElement extends VideoApiElement {
16
13
  #private;
17
14
  static get observedAttributes(): string[];
@@ -37,6 +34,8 @@ declare class MuxPlayerElement extends VideoApiElement {
37
34
  * Set the thumbnailTime offset used for the poster image.
38
35
  */
39
36
  set audio(val: boolean);
37
+ get nohotkeys(): boolean;
38
+ set nohotkeys(val: boolean);
40
39
  /**
41
40
  * Get the thumbnailTime offset used for the poster image.
42
41
  */
@@ -194,6 +193,9 @@ declare class MuxPlayerElement extends VideoApiElement {
194
193
  * Set the storyboard token for signing the storyboard URL.
195
194
  */
196
195
  set storyboardToken(val: string | undefined);
196
+ addTextTrack(kind: TextTrackKind, label: string, lang?: string, id?: string): TextTrack | undefined;
197
+ removeTextTrack(track: TextTrack): void;
198
+ get textTracks(): TextTrackList | undefined;
197
199
  }
198
200
  export declare function getVideoAttribute(el: MuxPlayerElement, name: string): string | null;
199
201
  export default MuxPlayerElement;
@@ -1,6 +1,8 @@
1
1
  export declare const Airplay: () => import("@github/template-parts").TemplateInstance;
2
2
  export declare const CaptionsOff: () => import("@github/template-parts").TemplateInstance;
3
3
  export declare const CaptionsOn: () => import("@github/template-parts").TemplateInstance;
4
+ export declare const CastEnter: () => import("@github/template-parts").TemplateInstance;
5
+ export declare const CastExit: () => import("@github/template-parts").TemplateInstance;
4
6
  export declare const FullscreenEnter: () => import("@github/template-parts").TemplateInstance;
5
7
  export declare const FullscreenExit: () => import("@github/template-parts").TemplateInstance;
6
8
  export declare const Pause: () => import("@github/template-parts").TemplateInstance;
@@ -1,16 +1,41 @@
1
- import 'media-chrome';
1
+ import { MediaTheme } from 'media-chrome';
2
2
  import '../media-chrome/time-display';
3
3
  declare type ThemeMuxTemplateProps = {
4
- streamType: string;
4
+ streamType: string | null;
5
+ nohotkeys?: boolean;
5
6
  audio: boolean;
6
- playerSize: string;
7
+ playerSize: string | null;
7
8
  defaultHiddenCaptions: boolean;
8
- forwardSeekOffset: number;
9
- backwardSeekOffset: number;
9
+ forwardSeekOffset: string | null;
10
+ backwardSeekOffset: string | null;
10
11
  };
12
+ export declare const parts: {
13
+ mediaChrome: string;
14
+ centerPlay: string;
15
+ centerSeekBackward: string;
16
+ centerSeekForward: string;
17
+ play: string;
18
+ seekBackward: string;
19
+ seekForward: string;
20
+ mute: string;
21
+ captions: string;
22
+ airplay: string;
23
+ pip: string;
24
+ fullscreen: string;
25
+ cast: string;
26
+ playbackRate: string;
27
+ volumeRange: string;
28
+ timeRange: string;
29
+ timeDisplay: string;
30
+ };
31
+ export default class MediaThemeMux extends MediaTheme {
32
+ static get observedAttributes(): string[];
33
+ attributeChangedCallback(): void;
34
+ render(): void;
35
+ }
11
36
  export declare const AudioVodChrome: (props: ThemeMuxTemplateProps) => import("../html").TemplateResult;
12
37
  export declare const AudioDvrChrome: (props: ThemeMuxTemplateProps) => import("../html").TemplateResult;
13
- export declare const AudioLiveChrome: (_props: ThemeMuxTemplateProps) => import("../html").TemplateResult;
38
+ export declare const AudioLiveChrome: () => import("../html").TemplateResult;
14
39
  export declare const VodChromeExtraSmall: (props: ThemeMuxTemplateProps) => import("../html").TemplateResult;
15
40
  export declare const VodChromeSmall: (props: ThemeMuxTemplateProps) => import("../html").TemplateResult;
16
41
  export declare const VodChromeLarge: (props: ThemeMuxTemplateProps) => import("../html").TemplateResult;
@@ -20,9 +45,4 @@ export declare const LiveChromeLarge: (props: ThemeMuxTemplateProps) => import("
20
45
  export declare const DvrChromeExtraSmall: (props: ThemeMuxTemplateProps) => import("../html").TemplateResult;
21
46
  export declare const DvrChromeSmall: (props: ThemeMuxTemplateProps) => import("../html").TemplateResult;
22
47
  export declare const DvrChromeLarge: (props: ThemeMuxTemplateProps) => import("../html").TemplateResult;
23
- declare class MediaThemeMux extends HTMLElement {
24
- static get observedAttributes(): string[];
25
- constructor();
26
- attributeChangedCallback(): void;
27
- }
28
- export default MediaThemeMux;
48
+ export {};
@@ -1,4 +1,3 @@
1
- import './media-theme-mux/media-theme-mux';
2
1
  import './dialog';
3
2
  import type { MuxTemplateProps } from './types';
4
3
  export declare const template: (props: MuxTemplateProps) => import("./html").TemplateResult;
@@ -48,6 +48,8 @@ declare class VideoApiElement extends HTMLElement {
48
48
  set poster(val: string);
49
49
  get playbackRate(): number;
50
50
  set playbackRate(val: number);
51
+ get defaultPlaybackRate(): number;
52
+ set defaultPlaybackRate(val: number);
51
53
  get crossOrigin(): string | null;
52
54
  set crossOrigin(val: string | null);
53
55
  get autoplay(): boolean;
@@ -56,6 +58,8 @@ declare class VideoApiElement extends HTMLElement {
56
58
  set loop(val: boolean);
57
59
  get muted(): boolean;
58
60
  set muted(val: boolean);
61
+ get defaultMuted(): boolean;
62
+ set defaultMuted(val: boolean);
59
63
  get playsInline(): boolean;
60
64
  set playsInline(val: boolean);
61
65
  get preload(): string | null;
@@ -13,6 +13,7 @@ export declare const getStoryboardURLFromPlaybackId: (playbackId?: string | unde
13
13
  token?: string | undefined;
14
14
  domain?: string | undefined;
15
15
  }) => string;
16
+ export declare function castThemeName(themeName?: string): string | undefined;
16
17
  export declare function toPropName(attrName: string): string;
17
18
  export declare const getLiveTime: (el: MuxPlayerElement) => number | undefined;
18
19
  export declare const seekToLive: (el: MuxPlayerElement) => void;
@@ -16,3 +16,8 @@ export declare class TemplateResult {
16
16
  export declare function html(strings: TemplateStringsArray, ...values: unknown[]): TemplateResult;
17
17
  export declare function render(result: TemplateResult, element: Node | NodeTemplatePart): void;
18
18
  export declare function createTemplateInstance(content: string, props?: any): TemplateInstance;
19
+ export declare const unsafeStatic: (...values: any[]) => {
20
+ $static$: (TemplateResult | {
21
+ strings: any[];
22
+ })[];
23
+ };
@@ -9,9 +9,6 @@ export declare type Tokens = {
9
9
  thumbnail?: string;
10
10
  storyboard?: string;
11
11
  };
12
- declare type MediaController = Element & {
13
- media: HTMLVideoElement;
14
- };
15
12
  declare class MuxPlayerElement extends VideoApiElement {
16
13
  private "MuxPlayerElement.#private";
17
14
  static readonly observedAttributes: string[];
@@ -36,6 +33,7 @@ declare class MuxPlayerElement extends VideoApiElement {
36
33
  * Set the thumbnailTime offset used for the poster image.
37
34
  */
38
35
  audio: boolean;
36
+ nohotkeys: boolean;
39
37
  /*
40
38
  * Get the thumbnailTime offset used for the poster image.
41
39
 
@@ -175,6 +173,9 @@ declare class MuxPlayerElement extends VideoApiElement {
175
173
  * Set the storyboard token for signing the storyboard URL.
176
174
  */
177
175
  storyboardToken: string | undefined;
176
+ addTextTrack(kind: TextTrackKind, label: string, lang?: string, id?: string): TextTrack | undefined;
177
+ removeTextTrack(track: TextTrack): void;
178
+ readonly textTracks: TextTrackList | undefined;
178
179
  }
179
180
  export declare function getVideoAttribute(el: MuxPlayerElement, name: string): string | null;
180
181
  export default MuxPlayerElement;
@@ -1,6 +1,8 @@
1
1
  export declare const Airplay: () => import("@github/template-parts").TemplateInstance;
2
2
  export declare const CaptionsOff: () => import("@github/template-parts").TemplateInstance;
3
3
  export declare const CaptionsOn: () => import("@github/template-parts").TemplateInstance;
4
+ export declare const CastEnter: () => import("@github/template-parts").TemplateInstance;
5
+ export declare const CastExit: () => import("@github/template-parts").TemplateInstance;
4
6
  export declare const FullscreenEnter: () => import("@github/template-parts").TemplateInstance;
5
7
  export declare const FullscreenExit: () => import("@github/template-parts").TemplateInstance;
6
8
  export declare const Pause: () => import("@github/template-parts").TemplateInstance;
@@ -1,16 +1,41 @@
1
- import 'media-chrome';
1
+ import { MediaTheme } from 'media-chrome';
2
2
  import '../media-chrome/time-display';
3
3
  declare type ThemeMuxTemplateProps = {
4
- streamType: string;
4
+ streamType: string | null;
5
+ nohotkeys?: boolean;
5
6
  audio: boolean;
6
- playerSize: string;
7
+ playerSize: string | null;
7
8
  defaultHiddenCaptions: boolean;
8
- forwardSeekOffset: number;
9
- backwardSeekOffset: number;
9
+ forwardSeekOffset: string | null;
10
+ backwardSeekOffset: string | null;
10
11
  };
12
+ export declare const parts: {
13
+ mediaChrome: string;
14
+ centerPlay: string;
15
+ centerSeekBackward: string;
16
+ centerSeekForward: string;
17
+ play: string;
18
+ seekBackward: string;
19
+ seekForward: string;
20
+ mute: string;
21
+ captions: string;
22
+ airplay: string;
23
+ pip: string;
24
+ fullscreen: string;
25
+ cast: string;
26
+ playbackRate: string;
27
+ volumeRange: string;
28
+ timeRange: string;
29
+ timeDisplay: string;
30
+ };
31
+ export default class MediaThemeMux extends MediaTheme {
32
+ static readonly observedAttributes: string[];
33
+ attributeChangedCallback(): void;
34
+ render(): void;
35
+ }
11
36
  export declare const AudioVodChrome: (props: ThemeMuxTemplateProps) => import("../html").TemplateResult;
12
37
  export declare const AudioDvrChrome: (props: ThemeMuxTemplateProps) => import("../html").TemplateResult;
13
- export declare const AudioLiveChrome: (_props: ThemeMuxTemplateProps) => import("../html").TemplateResult;
38
+ export declare const AudioLiveChrome: () => import("../html").TemplateResult;
14
39
  export declare const VodChromeExtraSmall: (props: ThemeMuxTemplateProps) => import("../html").TemplateResult;
15
40
  export declare const VodChromeSmall: (props: ThemeMuxTemplateProps) => import("../html").TemplateResult;
16
41
  export declare const VodChromeLarge: (props: ThemeMuxTemplateProps) => import("../html").TemplateResult;
@@ -20,9 +45,4 @@ export declare const LiveChromeLarge: (props: ThemeMuxTemplateProps) => import("
20
45
  export declare const DvrChromeExtraSmall: (props: ThemeMuxTemplateProps) => import("../html").TemplateResult;
21
46
  export declare const DvrChromeSmall: (props: ThemeMuxTemplateProps) => import("../html").TemplateResult;
22
47
  export declare const DvrChromeLarge: (props: ThemeMuxTemplateProps) => import("../html").TemplateResult;
23
- declare class MediaThemeMux extends HTMLElement {
24
- static readonly observedAttributes: string[];
25
- constructor();
26
- attributeChangedCallback(): void;
27
- }
28
- export default MediaThemeMux;
48
+ export {};
@@ -1,4 +1,3 @@
1
- import './media-theme-mux/media-theme-mux';
2
1
  import './dialog';
3
2
  import { MuxTemplateProps } from './types';
4
3
  export declare const template: (props: MuxTemplateProps) => import("./html").TemplateResult;
@@ -43,10 +43,12 @@ declare class VideoApiElement extends HTMLElement {
43
43
  src: string | null;
44
44
  poster: string;
45
45
  playbackRate: number;
46
+ defaultPlaybackRate: number;
46
47
  crossOrigin: string | null;
47
48
  autoplay: boolean;
48
49
  loop: boolean;
49
50
  muted: boolean;
51
+ defaultMuted: boolean;
50
52
  playsInline: boolean;
51
53
  preload: string | null;
52
54
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mux/mux-player",
3
- "version": "0.1.0-beta.23",
3
+ "version": "0.1.0-beta.26",
4
4
  "description": "An open source Mux player web component that Just Works™",
5
5
  "main": "./dist/index.cjs.js",
6
6
  "module": "./dist/index.mjs",
@@ -51,9 +51,9 @@
51
51
  },
52
52
  "dependencies": {
53
53
  "@github/template-parts": "^0.5.3",
54
- "@mux/mux-video": "0.8.1",
55
- "@mux/playback-core": "0.8.0",
56
- "media-chrome": "0.6.9"
54
+ "@mux/mux-video": "0.8.4",
55
+ "@mux/playback-core": "0.9.0",
56
+ "media-chrome": "0.9.0"
57
57
  },
58
58
  "devDependencies": {
59
59
  "@mux/open-process": "0.1.0",
@@ -103,5 +103,5 @@
103
103
  "@typescript-eslint/no-explicit-any": 0
104
104
  }
105
105
  },
106
- "gitHead": "df8c8fd0e616210d5ff40e7f1c6ff5906944efee"
106
+ "gitHead": "8e82f44785e4598dbcbf2806d6d41c3c8d106b8b"
107
107
  }
package/src/helpers.ts CHANGED
@@ -56,6 +56,13 @@ export const getStoryboardURLFromPlaybackId = (
56
56
  })}`;
57
57
  };
58
58
 
59
+ export function castThemeName(themeName?: string): string | undefined {
60
+ if (themeName && /^media-theme-[\w-]+$/.test(themeName)) {
61
+ return themeName;
62
+ }
63
+ return undefined;
64
+ }
65
+
59
66
  const attrToPropNameMap: Record<string, string> = {
60
67
  crossorigin: 'crossOrigin',
61
68
  playsinline: 'playsInline',
package/src/html.ts CHANGED
@@ -149,8 +149,49 @@ export class TemplateResult {
149
149
  }
150
150
  }
151
151
 
152
+ const stringsCache = new Map();
152
153
  const defaultProcessor = createProcessor(processPart);
153
154
  export function html(strings: TemplateStringsArray, ...values: unknown[]): TemplateResult {
155
+ const staticStrings: any = [''];
156
+ const dynamicValues: any[] = [];
157
+ let staticValues;
158
+ let hasStatics = false;
159
+
160
+ // Here the unsafe static values are moved from the string expressions
161
+ // to the static strings so they can be used in the cache key and later
162
+ // be used to generate the HTML via the <template> element.
163
+ const join = (strs: TemplateStringsArray, vals: any[] = []) => {
164
+ staticStrings[staticStrings.length - 1] = staticStrings[staticStrings.length - 1] + strs[0];
165
+
166
+ vals.forEach((dynamicValue, i) => {
167
+ if ((staticValues = dynamicValue?.$static$) !== undefined) {
168
+ staticValues.forEach((staticValue: TemplateResult) => {
169
+ join(staticValue.strings, staticValue.values);
170
+ });
171
+
172
+ staticStrings[staticStrings.length - 1] = staticStrings[staticStrings.length - 1] + strs[i + 1];
173
+ hasStatics = true;
174
+ } else {
175
+ dynamicValues.push(dynamicValue);
176
+ staticStrings.push(strs[i + 1]);
177
+ }
178
+ });
179
+ };
180
+
181
+ join(strings, values);
182
+
183
+ if (hasStatics) {
184
+ // Tagged template literals with the same static strings return the same
185
+ // TemplateStringsArray, aka they are cached. emulate this behavior w/ a Map.
186
+ const key = staticStrings.join('$$html$$');
187
+ strings = stringsCache.get(key);
188
+ if (strings === undefined) {
189
+ (staticStrings as any).raw = staticStrings;
190
+ stringsCache.set(key, (strings = staticStrings));
191
+ }
192
+ values = dynamicValues;
193
+ }
194
+
154
195
  return new TemplateResult(strings, values, defaultProcessor);
155
196
  }
156
197
 
@@ -163,3 +204,12 @@ export function createTemplateInstance(content: string, props?: any) {
163
204
  template.innerHTML = content;
164
205
  return new TemplateInstance(template, props);
165
206
  }
207
+
208
+ export const unsafeStatic = (...values: any[]) => ({
209
+ ['$static$']: values.map((value) => {
210
+ if (value instanceof TemplateResult) return value;
211
+ // Only allow word characters and dashes for security.
212
+ if (!/\w-/.test(value)) return { strings: [] };
213
+ return { strings: [value] };
214
+ }),
215
+ });
package/src/index.ts CHANGED
@@ -2,9 +2,8 @@
2
2
  import '@mux/playback-core';
3
3
  // @ts-ignore
4
4
  import { MediaController } from 'media-chrome';
5
- import MediaThemeMux from './media-theme-mux/media-theme-mux';
6
5
  import MuxVideoElement, { MediaError } from '@mux/mux-video';
7
- import { Metadata, StreamTypes } from '@mux/playback-core';
6
+ import { Metadata, StreamTypes, addTextTrack, removeTextTrack } from '@mux/playback-core';
8
7
  import VideoApiElement, { initVideoApi } from './video-api';
9
8
  import { getPlayerVersion, isInLiveWindow, seekToLive, toPropName } from './helpers';
10
9
  import { template } from './template';
@@ -21,8 +20,6 @@ export type Tokens = {
21
20
  storyboard?: string;
22
21
  };
23
22
 
24
- type MediaController = Element & { media: HTMLVideoElement };
25
-
26
23
  const streamTypeValues = Object.values(StreamTypes);
27
24
 
28
25
  const SMALL_BREAKPOINT = 700;
@@ -75,6 +72,7 @@ const PlayerAttributes = {
75
72
  STORYBOARD_TOKEN: 'storyboard-token',
76
73
  THUMBNAIL_TIME: 'thumbnail-time',
77
74
  AUDIO: 'audio',
75
+ NOHOTKEYS: 'nohotkeys',
78
76
  };
79
77
 
80
78
  function getProps(el: MuxPlayerElement, state?: any): MuxTemplateProps {
@@ -85,10 +83,14 @@ function getProps(el: MuxPlayerElement, state?: any): MuxTemplateProps {
85
83
  // it's used if/when it's been explicitly set "from the outside"
86
84
  // (See template.ts for additional context) (CJP)
87
85
  poster: el.getAttribute('poster'),
86
+ theme: el.getAttribute('theme'),
88
87
  thumbnailTime: !el.tokens.thumbnail && el.thumbnailTime,
89
88
  autoplay: el.autoplay,
90
89
  crossOrigin: el.crossOrigin,
91
90
  loop: el.loop,
91
+ // NOTE: Renaming internal prop due to state (sometimes derived from attributeChangedCallback attr values)
92
+ // overwriting prop value (type mismatch: string vs. boolean) (CJP)
93
+ noHotKeys: el.hasAttribute(PlayerAttributes.NOHOTKEYS),
92
94
  muted: el.muted,
93
95
  paused: el.paused,
94
96
  playsInline: el.playsInline,
@@ -175,19 +177,25 @@ class MuxPlayerElement extends VideoApiElement {
175
177
  // Fixes a bug in React where mux-player's CE children were not upgraded yet.
176
178
  // These lines ensure the rendered mux-video and media-controller are upgraded,
177
179
  // even before they are connected to the main document.
178
- customElements.upgrade(this.theme as Node);
179
- if (!(this.theme instanceof MediaThemeMux)) {
180
- logger.error('<media-theme-mux> failed to upgrade!');
180
+ try {
181
+ customElements.upgrade(this.theme as Node);
182
+ if (!(this.theme instanceof HTMLElement)) throw '';
183
+ } catch (error) {
184
+ logger.error(`<${this.theme?.localName}> failed to upgrade!`);
181
185
  }
182
186
 
183
- customElements.upgrade(this.media as Node);
184
- if (!(this.media instanceof MuxVideoElement)) {
187
+ try {
188
+ customElements.upgrade(this.media as Node);
189
+ if (!(this.media instanceof MuxVideoElement)) throw '';
190
+ } catch (error) {
185
191
  logger.error('<mux-video> failed to upgrade!');
186
192
  }
187
193
 
188
- customElements.upgrade(this.mediaController as Node);
189
- if (!(this.mediaController instanceof MediaController)) {
190
- logger.error('<media-controller> failed to upgrade!');
194
+ try {
195
+ customElements.upgrade(this.mediaController as Node);
196
+ if (!(this.mediaController instanceof MediaController)) throw '';
197
+ } catch (error) {
198
+ logger.error(`<media-controller> failed to upgrade!`);
191
199
  }
192
200
 
193
201
  initVideoApi(this);
@@ -545,7 +553,7 @@ class MuxPlayerElement extends VideoApiElement {
545
553
  file: 'invalid-stream-type.md',
546
554
  message: String(
547
555
  i18n(
548
- `No stream-type value supplied. Defaulting to \`on-demand\`. Please provide stream-type as either: \`on-demand\`, \`live\` or \`ll-live\``
556
+ `No stream-type value supplied. Defaulting to \`on-demand\`. Please provide stream-type as either: \`on-demand\`, \`live\`, \`ll-live\`, \`live:dvr\`, or \`ll-live:dvr\``
549
557
  )
550
558
  ),
551
559
  });
@@ -553,7 +561,7 @@ class MuxPlayerElement extends VideoApiElement {
553
561
  logger.devlog({
554
562
  file: 'invalid-stream-type.md',
555
563
  message: i18n(
556
- `Invalid stream-type value supplied: \`{streamType}\`. Please provide stream-type as either: \`on-demand\`, \`live\` or \`ll-live\``
564
+ `Invalid stream-type value supplied: \`{streamType}\`. Please provide stream-type as either: \`on-demand\`, \`live\`, \`ll-live\`, \`live:dvr\`, or \`ll-live:dvr\``
557
565
  ).format({ streamType: this.streamType }),
558
566
  });
559
567
  }
@@ -603,6 +611,17 @@ class MuxPlayerElement extends VideoApiElement {
603
611
  this.setAttribute(PlayerAttributes.AUDIO, '');
604
612
  }
605
613
 
614
+ get nohotkeys() {
615
+ return this.hasAttribute(PlayerAttributes.NOHOTKEYS);
616
+ }
617
+
618
+ set nohotkeys(val: boolean) {
619
+ if (!val) {
620
+ this.removeAttribute(PlayerAttributes.NOHOTKEYS);
621
+ }
622
+ this.setAttribute(PlayerAttributes.NOHOTKEYS, '');
623
+ }
624
+
606
625
  /**
607
626
  * Get the thumbnailTime offset used for the poster image.
608
627
  */
@@ -842,7 +861,15 @@ class MuxPlayerElement extends VideoApiElement {
842
861
  * Set the metadata object for Mux Data.
843
862
  */
844
863
  set metadata(val: Readonly<Metadata> | undefined) {
845
- if (this.media) this.media.metadata = val;
864
+ if (!this.#isInit) {
865
+ this.#init();
866
+ }
867
+ // NOTE: This condition should never be met. If it is, there is a bug (CJP)
868
+ if (!this.media) {
869
+ logger.error('underlying media element missing when trying to set metadata. metadata will not be set.');
870
+ return;
871
+ }
872
+ this.media.metadata = val;
846
873
  }
847
874
 
848
875
  /**
@@ -908,6 +935,22 @@ class MuxPlayerElement extends VideoApiElement {
908
935
  set storyboardToken(val) {
909
936
  this.setAttribute(PlayerAttributes.STORYBOARD_TOKEN, `${val}`);
910
937
  }
938
+
939
+ addTextTrack(kind: TextTrackKind, label: string, lang?: string, id?: string) {
940
+ const mediaEl = this.media?.nativeEl;
941
+ if (!mediaEl) return;
942
+ return addTextTrack(mediaEl, kind, label, lang, id);
943
+ }
944
+
945
+ removeTextTrack(track: TextTrack) {
946
+ const mediaEl = this.media?.nativeEl;
947
+ if (!mediaEl) return;
948
+ return removeTextTrack(mediaEl, track);
949
+ }
950
+
951
+ get textTracks() {
952
+ return this.media?.textTracks;
953
+ }
911
954
  }
912
955
 
913
956
  export function getVideoAttribute(el: MuxPlayerElement, name: string) {
@@ -0,0 +1,6 @@
1
+ <svg aria-hidden="true" viewBox="0 0 20 18" slot="enter">
2
+ <path d="M0 12.5V14C2.2056 14 4 15.7944 4 18H5.5C5.5 14.9624 3.0376 12.5 0 12.5Z"/>
3
+ <path d="M0 15.5V18H2.5C2.5 16.6193 1.3807 15.5 0 15.5Z"/>
4
+ <path d="M0 9.5V11C3.8599 11 7 14.1402 7 18H8.5C8.5 13.3055 4.6945 9.5 0 9.5Z"/>
5
+ <path d="M19 -0.000213623H1C0.4478 -0.000213623 0 0.447386 0 0.999786V7.98359C0.4243 7.98359 0.8396 8.01859 1.25 8.06979V1.24979H18.75V16.75H9.9302C9.9814 17.1604 10.0164 17.5757 10.0164 18H19C19.5523 18 20 17.5522 20 17V0.999786C20 0.447386 19.5523 -0.000213623 19 -0.000213623Z"/>
6
+ </svg>
@@ -0,0 +1,7 @@
1
+ <svg aria-hidden="true" viewBox="0 0 20 18" slot="exit">
2
+ <path d="M0 12.5V14C2.2056 14 4 15.7944 4 18H5.5C5.5 14.9624 3.0376 12.5 0 12.5Z" />
3
+ <path d="M0 15.5V18H2.5C2.5 16.6193 1.3807 15.5 0 15.5Z" />
4
+ <path d="M0 9.5V11C3.8599 11 7 14.1402 7 18H8.5C8.5 13.3055 4.6945 9.5 0 9.5Z" />
5
+ <path d="M19 -0.000198364H1C0.4478 -0.000198364 0 0.447402 0 0.999802V7.9836C0.4243 7.9836 0.8396 8.0186 1.25 8.0698V1.2498H18.75V16.75H9.9302C9.9814 17.1604 10.0164 17.5757 10.0164 18H19C19.5523 18 20 17.5522 20 17V0.999802C20 0.447402 19.5523 -0.000198364 19 -0.000198364Z" />
6
+ <path d="M17.5 2.4998H2.5V8.311C6.0193 9.2171 8.783 11.9807 9.689 15.5001H17.5V2.4998Z" />
7
+ </svg>
@@ -3,6 +3,8 @@ import { createTemplateInstance } from '../html';
3
3
  import airplayIcon from './icons/airplay.svg';
4
4
  import captionsOffIcon from './icons/captions-off.svg';
5
5
  import captionsOnIcon from './icons/captions-on.svg';
6
+ import castEnter from './icons/cast-enter.svg';
7
+ import castExit from './icons/cast-exit.svg';
6
8
  import fullscreenEnter from './icons/fullscreen-enter.svg';
7
9
  import fullscreenExit from './icons/fullscreen-exit.svg';
8
10
  import pause from './icons/pause.svg';
@@ -19,6 +21,8 @@ import volumeOff from './icons/volume-off.svg';
19
21
  export const Airplay = () => createTemplateInstance(airplayIcon);
20
22
  export const CaptionsOff = () => createTemplateInstance(captionsOffIcon);
21
23
  export const CaptionsOn = () => createTemplateInstance(captionsOnIcon);
24
+ export const CastEnter = () => createTemplateInstance(castEnter);
25
+ export const CastExit = () => createTemplateInstance(castExit);
22
26
  export const FullscreenEnter = () => createTemplateInstance(fullscreenEnter);
23
27
  export const FullscreenExit = () => createTemplateInstance(fullscreenExit);
24
28
  export const Pause = () => createTemplateInstance(pause);