├── .Rbuildignore ├── .babelrc ├── .builderrc ├── .circleci └── config.yml ├── .eslintrc ├── .github └── FUNDING.yml ├── .gitignore ├── .npmignore ├── CHANGELOG.md ├── CODE_OF_CONDUCT.md ├── CONTRIBUTING.md ├── DESCRIPTION ├── LICENSE ├── MANIFEST.in ├── NAMESPACE ├── R ├── dashPlayer.R └── internal.R ├── README.md ├── _validate_init.py ├── dash-info.yaml ├── dash_player ├── DashPlayer.py ├── __init__.py ├── _imports_.py ├── async-dashplayer.js ├── async-dashplayer.js.map ├── dash_player.min.js ├── dash_player.min.js.map └── package.json ├── index.html ├── inst └── deps │ ├── async-dashplayer.js │ ├── async-dashplayer.js.map │ ├── dash_player.min.js │ └── dash_player.min.js.map ├── man ├── dashPlayer-package.Rd └── dashPlayer.Rd ├── package-lock.json ├── package.json ├── requirements-dev.txt ├── requirements.txt ├── review_checklist.md ├── setup.py ├── src ├── demo │ ├── App.js │ └── index.js └── lib │ ├── components │ └── DashPlayer.react.js │ ├── fragments │ └── DashPlayer.react.js │ └── index.js ├── tests ├── __init__.py └── test_integration.py ├── webpack.config.js └── webpack.serve.config.js /.Rbuildignore: -------------------------------------------------------------------------------- 1 | # ignore JS config files/folders 2 | node_modules/ 3 | coverage/ 4 | src/ 5 | lib/ 6 | .babelrc 7 | .builderrc 8 | .eslintrc 9 | .npmignore 10 | .editorconfig 11 | .eslintignore 12 | .prettierrc 13 | .circleci 14 | .github 15 | 16 | # demo folder has special meaning in R 17 | # this should hopefully make it still 18 | # allow for the possibility to make R demos 19 | demo/.*\.js 20 | demo/.*\.html 21 | demo/.*\.css 22 | 23 | # ignore Python files/folders 24 | setup.py 25 | usage.py 26 | setup.py 27 | requirements.txt 28 | MANIFEST.in 29 | CHANGELOG.md 30 | test/ 31 | # CRAN has weird LICENSE requirements 32 | LICENSE.txt 33 | ^.*\.Rproj$ 34 | ^\.Rproj\.user$ 35 | -------------------------------------------------------------------------------- /.babelrc: -------------------------------------------------------------------------------- 1 | { 2 | "presets": ["@babel/preset-env", "@babel/preset-react"], 3 | "env": { 4 | "production": { 5 | "plugins": ["@babel/plugin-proposal-object-rest-spread", "styled-jsx/babel", "@babel/plugin-syntax-dynamic-import"] 6 | }, 7 | "development": { 8 | "plugins": ["@babel/plugin-proposal-object-rest-spread", "styled-jsx/babel", "@babel/plugin-syntax-dynamic-import"] 9 | }, 10 | "test": { 11 | "plugins": ["@babel/plugin-proposal-object-rest-spread", "styled-jsx/babel-test", "@babel/plugin-syntax-dynamic-import"] 12 | } 13 | } 14 | } 15 | 16 | -------------------------------------------------------------------------------- /.builderrc: -------------------------------------------------------------------------------- 1 | --- 2 | archetypes: 3 | - dash-components-archetype 4 | -------------------------------------------------------------------------------- /.circleci/config.yml: -------------------------------------------------------------------------------- 1 | version: 2.1 2 | 3 | orbs: 4 | python: circleci/python@1.5.0 5 | browser-tools: circleci/browser-tools@1.4.1 6 | node: circleci/node@5.0.3 7 | 8 | jobs: 9 | test-and-lint: 10 | docker: 11 | - image: cimg/python:3.9 12 | steps: 13 | - node/install 14 | - browser-tools/install-chrome 15 | - browser-tools/install-chromedriver 16 | - checkout 17 | - python/install-packages: 18 | pkg-manager: pip 19 | pip-dependency-file: requirements-dev.txt 20 | - run: 21 | name: Lint with flake8 22 | command: npm run lint 23 | - run: 24 | name: Build package 25 | command: | 26 | npm install 27 | npm run build 28 | - run: 29 | name: Run tests 30 | command: npm run test -- --headless 31 | - run: 32 | name: Run tests using React 18 33 | command: REACT_VERSION=18.2.0 npm run test -- --headless 34 | 35 | workflows: 36 | run-tests: 37 | jobs: 38 | - test-and-lint 39 | -------------------------------------------------------------------------------- /.eslintrc: -------------------------------------------------------------------------------- 1 | { 2 | "extends": ["eslint:recommended", "prettier"], 3 | "parser": "babel-eslint", 4 | "parserOptions": { 5 | "ecmaVersion": 6, 6 | "sourceType": "module", 7 | "ecmaFeatures": { 8 | "arrowFunctions": true, 9 | "blockBindings": true, 10 | "classes": true, 11 | "defaultParams": true, 12 | "destructuring": true, 13 | "forOf": true, 14 | "generators": true, 15 | "modules": true, 16 | "templateStrings": true, 17 | "jsx": true 18 | } 19 | }, 20 | "env": { 21 | "browser": true, 22 | "es6": true, 23 | "jasmine": true, 24 | "jest": true, 25 | "node": true 26 | }, 27 | "globals": { 28 | "jest": true 29 | }, 30 | "plugins": [ 31 | "react", 32 | "import" 33 | ], 34 | "rules": { 35 | "accessor-pairs": ["error"], 36 | "block-scoped-var": ["error"], 37 | "consistent-return": ["error"], 38 | "curly": ["error", "all"], 39 | "default-case": ["error"], 40 | "dot-location": ["off"], 41 | "dot-notation": ["error"], 42 | "eqeqeq": ["error"], 43 | "guard-for-in": ["off"], 44 | "import/named": ["off"], 45 | "import/no-duplicates": ["error"], 46 | "import/no-named-as-default": ["error"], 47 | "new-cap": ["error"], 48 | "no-alert": [1], 49 | "no-caller": ["error"], 50 | "no-case-declarations": ["error"], 51 | "no-console": ["off"], 52 | "no-div-regex": ["error"], 53 | "no-dupe-keys": ["error"], 54 | "no-else-return": ["error"], 55 | "no-empty-pattern": ["error"], 56 | "no-eq-null": ["error"], 57 | "no-eval": ["error"], 58 | "no-extend-native": ["error"], 59 | "no-extra-bind": ["error"], 60 | "no-extra-boolean-cast": ["error"], 61 | "no-inline-comments": ["error"], 62 | "no-implicit-coercion": ["error"], 63 | "no-implied-eval": ["error"], 64 | "no-inner-declarations": ["off"], 65 | "no-invalid-this": ["error"], 66 | "no-iterator": ["error"], 67 | "no-labels": ["error"], 68 | "no-lone-blocks": ["error"], 69 | "no-loop-func": ["error"], 70 | "no-multi-str": ["error"], 71 | "no-native-reassign": ["error"], 72 | "no-new": ["error"], 73 | "no-new-func": ["error"], 74 | "no-new-wrappers": ["error"], 75 | "no-param-reassign": ["error"], 76 | "no-process-env": ["warn"], 77 | "no-proto": ["error"], 78 | "no-redeclare": ["error"], 79 | "no-return-assign": ["error"], 80 | "no-script-url": ["error"], 81 | "no-self-compare": ["error"], 82 | "no-sequences": ["error"], 83 | "no-shadow": ["off"], 84 | "no-throw-literal": ["error"], 85 | "no-undefined": ["error"], 86 | "no-unused-expressions": ["error"], 87 | "no-use-before-define": ["error", "nofunc"], 88 | "no-useless-call": ["error"], 89 | "no-useless-concat": ["error"], 90 | "no-with": ["error"], 91 | "prefer-const": ["error"], 92 | "radix": ["error"], 93 | "react/jsx-no-duplicate-props": ["error"], 94 | "react/jsx-no-undef": ["error"], 95 | "react/jsx-uses-react": ["error"], 96 | "react/jsx-uses-vars": ["error"], 97 | "react/no-did-update-set-state": ["error"], 98 | "react/no-direct-mutation-state": ["error"], 99 | "react/no-is-mounted": ["error"], 100 | "react/no-unknown-property": ["error"], 101 | "react/prefer-es6-class": ["error", "always"], 102 | "react/prop-types": "error", 103 | "valid-jsdoc": ["off"], 104 | "yoda": ["error"], 105 | "spaced-comment": ["error", "always", { 106 | "block": { 107 | "exceptions": ["*"] 108 | } 109 | }], 110 | "no-unused-vars": ["error", { 111 | "args": "after-used", 112 | "argsIgnorePattern": "^_", 113 | "caughtErrorsIgnorePattern": "^e$" 114 | }], 115 | "no-magic-numbers": ["error", { 116 | "ignoreArrayIndexes": true, 117 | "ignore": [-1, 0, 1, 2, 3, 100, 10, 0.5] 118 | }], 119 | "no-underscore-dangle": ["off"] 120 | } 121 | } 122 | -------------------------------------------------------------------------------- /.github/FUNDING.yml: -------------------------------------------------------------------------------- 1 | custom: https://plot.ly/products/consulting-and-oem/ 2 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | build/ 2 | coverage/ 3 | dist/ 4 | lib/bundle.js* 5 | node_modules/ 6 | dash_player/metadata.json 7 | dash_player/bundle.js* 8 | .npm 9 | vv/ 10 | venv/ 11 | *.pyc 12 | *.egg-info 13 | *.log 14 | .DS_Store 15 | .idea 16 | *.ipynb_checkpoints -------------------------------------------------------------------------------- /.npmignore: -------------------------------------------------------------------------------- 1 | node_modules/ 2 | .npm 3 | .git/ 4 | vv/ 5 | venv/ 6 | *.pyc 7 | *.log 8 | .DS_Store 9 | 10 | -------------------------------------------------------------------------------- /CHANGELOG.md: -------------------------------------------------------------------------------- 1 | # Change Log for Dash Player 2 | 3 | All notable changes to `dash-player` will be documented in this file. 4 | This project adheres to [Semantic Versioning](https://semver.org/). 5 | 6 | Changes to `dash-player` were sponsored by Volkswagen's Center of Excellence for Battery Systems. 7 | 8 |

9 | 10 |

11 | 12 | --- 13 | 14 | ## [1.1.0] - 2023-03-16 15 | 16 | ## Changed 17 | - [#73](https://github.com/plotly/dash-player/pull/73) Converted the JS bundle to async loading 18 | 19 | ## Updated 20 | - [#76](https://github.com/plotly/dash-player/pull/76) Updated dependencies 21 | 22 | ## [1.0.6] - 2022-12-12 23 | 24 | ## Changed 25 | 26 | - [#68](https://github.com/plotly/dash-player/pull/66) Change partnership info and improve logo readability 27 | 28 | --- 29 | 30 | ## [1.0.5] - 2022-12-08 31 | 32 | ### Added 33 | 34 | - [#64](https://github.com/plotly/dash-player/pull/64) Add partnership information to `README` and `CHANGELOG` 35 | 36 | ## Changed 37 | 38 | - [#66](https://github.com/plotly/dash-player/pull/66) Remove all usage files and replace with link to official documentaion 39 | 40 | --- 41 | 42 | ## [1.0.4] - 2022-12-02 43 | 44 | ## Fixed 45 | 46 | - [#62](https://github.com/plotly/dash-player/pull/62) Fix typo in README 47 | 48 | ## Changed 49 | 50 | - [#62](https://github.com/plotly/dash-player/pull/62) Remove `usage-method.py` and revamp `usage-advanced.py` 51 | 52 | --- 53 | 54 | ## [1.0.3] - 2022-11-10 55 | 56 | ## Fixed 57 | 58 | - [#57](https://github.com/plotly/dash-player/pull/57) Fix typo in property description 59 | 60 | --- 61 | 62 | ## [1.0.2] - 2022-10-20 63 | 64 | ## Changed 65 | 66 | - [#53](https://github.com/plotly/dash-player/pull/53) Use README as package description 67 | - [#54](https://github.com/plotly/dash-player/pull/54) Bump `npm` and `node` versions and remove an obsolete file to reduce the package size 68 | 69 | --- 70 | 71 | ## [1.0.0] - 2022-10-20 72 | 73 | This release is `v1.0.0` to indicate that `dash-player` is now considered production-ready. 74 | 75 | ### Added 76 | 77 | - [#47](https://github.com/plotly/dash-player/pull/47) Add className property to `dash-player` 78 | - [#49](https://github.com/plotly/dash-player/pull/49) Pass in the `id` property to ReactPlayer 79 | - [#50](https://github.com/plotly/dash-player/pull/50) Add testing to the CI process 80 | 81 | ### Changed 82 | 83 | - [#40](https://github.com/plotly/dash-player/pull/40) Updates dependencies in `packages.json` 84 | - [#43](https://github.com/plotly/dash-player/pull/43) Remove the `extract-meta.js` file 85 | - [#41](https://github.com/plotly/dash-player/pull/41) Add build instructions to `README.md` 86 | 87 | ### Fixed 88 | 89 | - [#32](https://github.com/plotly/dash-player/pull/32) Fix errors and replace broken URLs in demo Python files 90 | - [#48](https://github.com/plotly/dash-player/pull/48) Fix issue with `currentTime`, `secondsLoaded`, and `duration` not loading 91 | 92 | --- 93 | 94 | ## [0.0.1] - 2018-08-02 95 | 96 | ### Added 97 | 98 | - [#1](https://github.com/plotly/dash-player/pull/1) Initial component release 99 | -------------------------------------------------------------------------------- /CODE_OF_CONDUCT.md: -------------------------------------------------------------------------------- 1 | # Contributor Covenant Code of Conduct 2 | 3 | ## Our Pledge 4 | 5 | In the interest of fostering an open and welcoming environment, we as contributors and maintainers pledge to making participation in our project and our community a harassment-free experience for everyone, regardless of age, body size, disability, ethnicity, gender identity and expression, level of experience, nationality, personal appearance, race, religion, or sexual identity and orientation. 6 | 7 | ## Our Standards 8 | 9 | Examples of behavior that contributes to creating a positive environment include: 10 | 11 | * Using welcoming and inclusive language 12 | * Being respectful of differing viewpoints and experiences 13 | * Gracefully accepting constructive criticism 14 | * Focusing on what is best for the community 15 | * Showing empathy towards other community members 16 | 17 | Examples of unacceptable behavior by participants include: 18 | 19 | * The use of sexualized language or imagery and unwelcome sexual attention or advances 20 | * Trolling, insulting/derogatory comments, and personal or political attacks 21 | * Public or private harassment 22 | * Publishing others' private information, such as a physical or electronic address, without explicit permission 23 | * Other conduct which could reasonably be considered inappropriate in a professional setting 24 | 25 | ## Our Responsibilities 26 | 27 | Project maintainers are responsible for clarifying the standards of acceptable behavior and are expected to take appropriate and fair corrective action in response to any instances of unacceptable behavior. 28 | 29 | Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, or to ban temporarily or permanently any contributor for other behaviors that they deem inappropriate, threatening, offensive, or harmful. 30 | 31 | ## Scope 32 | 33 | This Code of Conduct applies both within project spaces and in public spaces when an individual is representing the project or its community. Examples of representing a project or community include using an official project e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event. Representation of a project may be further defined and clarified by project maintainers. 34 | 35 | ## Enforcement 36 | 37 | Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project team at accounts@plot.ly. All complaints will be reviewed and investigated and will result in a response that is deemed necessary and appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to the reporter of an incident. Further details of specific enforcement policies may be posted separately. 38 | 39 | Project maintainers who do not follow or enforce the Code of Conduct in good faith may face temporary or permanent repercussions as determined by other members of the project's leadership. 40 | 41 | ## Attribution 42 | 43 | This Code of Conduct is adapted from the [Contributor Covenant](http://contributor-covenant.org), version 1.4, available at [http://contributor-covenant.org/version/1/4](http://contributor-covenant.org/version/1/4/), and may also be found online at . 44 | -------------------------------------------------------------------------------- /CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | # CONTRIBUTING 2 | 3 | ## Build manually 4 | 5 | We recommend the following versions to build this package: 6 | 7 | - `node`: 16.17.0 8 | - `npm`: 8.15.0 9 | 10 | To generate builds manually, run the following: 11 | 12 | ```sh 13 | $ pip install -r requirements-dev.txt 14 | $ npm install 15 | $ npm run build 16 | ``` 17 | -------------------------------------------------------------------------------- /DESCRIPTION: -------------------------------------------------------------------------------- 1 | Package: dashPlayer 2 | Title: Interactive Media Player Component for Dash 3 | 4 | Version: 1.1.0 5 | Description: Dash Player is a dash component for playing a variety of URLs, including file paths, YouTube, Facebook, Twitch, SoundCloud, Streamable, Vimeo, Wistia, Mixcloud, and DailyMotion. It is wrapped around the react-player component. 6 | 7 | Depends: R (>= 3.0.2) 8 | Imports: 9 | Suggests: 10 | Authors@R: person("Xing", "Lu", role = c("aut", "cre"), email = "xinghan@plot.ly") 11 | License: MIT + file LICENSE 12 | URL: https://github.com/plotly/dash-player 13 | BugReports: https://github.com/plotly/dash-player/issues 14 | Encoding: UTF-8 15 | LazyData: true 16 | KeepSource: true 17 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2018-2024 Plotly Technologies Inc. 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 13 | all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | THE SOFTWARE. 22 | -------------------------------------------------------------------------------- /MANIFEST.in: -------------------------------------------------------------------------------- 1 | include dash_player/*.js 2 | include dash_player/*.js.map 3 | include dash_player/metadata.json 4 | include dash_player/package.json 5 | include README.md 6 | -------------------------------------------------------------------------------- /NAMESPACE: -------------------------------------------------------------------------------- 1 | # AUTO GENERATED FILE - DO NOT EDIT 2 | 3 | export(DashPlayer) 4 | export(dashPlayer) -------------------------------------------------------------------------------- /R/dashPlayer.R: -------------------------------------------------------------------------------- 1 | # AUTO GENERATED FILE - DO NOT EDIT 2 | 3 | #' @export 4 | dashPlayer <- function(id=NULL, className=NULL, controls=NULL, currentTime=NULL, duration=NULL, height=NULL, intervalCurrentTime=NULL, intervalDuration=NULL, intervalSecondsLoaded=NULL, loop=NULL, muted=NULL, playbackRate=NULL, playing=NULL, playsinline=NULL, secondsLoaded=NULL, seekTo=NULL, style=NULL, url=NULL, volume=NULL, width=NULL) { 5 | 6 | props <- list(id=id, className=className, controls=controls, currentTime=currentTime, duration=duration, height=height, intervalCurrentTime=intervalCurrentTime, intervalDuration=intervalDuration, intervalSecondsLoaded=intervalSecondsLoaded, loop=loop, muted=muted, playbackRate=playbackRate, playing=playing, playsinline=playsinline, secondsLoaded=secondsLoaded, seekTo=seekTo, style=style, url=url, volume=volume, width=width) 7 | if (length(props) > 0) { 8 | props <- props[!vapply(props, is.null, logical(1))] 9 | } 10 | component <- list( 11 | props = props, 12 | type = 'DashPlayer', 13 | namespace = 'dash_player', 14 | propNames = c('id', 'className', 'controls', 'currentTime', 'duration', 'height', 'intervalCurrentTime', 'intervalDuration', 'intervalSecondsLoaded', 'loop', 'muted', 'playbackRate', 'playing', 'playsinline', 'secondsLoaded', 'seekTo', 'style', 'url', 'volume', 'width'), 15 | package = 'dashPlayer' 16 | ) 17 | 18 | structure(component, class = c('dash_component', 'list')) 19 | } 20 | -------------------------------------------------------------------------------- /R/internal.R: -------------------------------------------------------------------------------- 1 | .dashPlayer_js_metadata <- function() { 2 | deps_metadata <- list(`dash_player` = structure(list(name = "dash_player", 3 | version = "1.1.0", src = list(href = NULL, 4 | file = "deps"), meta = NULL, 5 | script = 'dash_player.min.js', 6 | stylesheet = NULL, head = NULL, attachment = NULL, package = "dashPlayer", 7 | all_files = FALSE), class = "html_dependency"), 8 | `dash_player` = structure(list(name = "dash_player", 9 | version = "1.1.0", src = list(href = NULL, 10 | file = "deps"), meta = NULL, 11 | script = 'dash_player.min.js.map', 12 | stylesheet = NULL, head = NULL, attachment = NULL, package = "dashPlayer", 13 | all_files = FALSE, dynamic = TRUE), class = "html_dependency"), 14 | `dash_player` = structure(list(name = "dash_player", 15 | version = "1.1.0", src = list(href = NULL, 16 | file = "deps"), meta = NULL, 17 | script = 'async-dashplayer.js', 18 | stylesheet = NULL, head = NULL, attachment = NULL, package = "dashPlayer", 19 | all_files = FALSE, async = TRUE), class = "html_dependency"), 20 | `dash_player` = structure(list(name = "dash_player", 21 | version = "1.1.0", src = list(href = NULL, 22 | file = "deps"), meta = NULL, 23 | script = 'async-dashplayer.js.map', 24 | stylesheet = NULL, head = NULL, attachment = NULL, package = "dashPlayer", 25 | all_files = FALSE, dynamic = TRUE), class = "html_dependency")) 26 | return(deps_metadata) 27 | } 28 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Dash Player 2 | 3 | ![GitHub](https://img.shields.io/github/license/mashape/apistatus.svg) 4 | [![GitHub stars](https://img.shields.io/github/stars/xhlulu/dash-player.svg)](https://github.com/xhlulu/dash-player/stargazers) 5 | 6 |
7 | 8 | Maintained by Plotly 9 | 10 |
11 | 12 | 13 | Dash Player is a Dash component for playing a variety of URLs, including file paths, YouTube, Facebook, Twitch, SoundCloud, Streamable, Vimeo, Wistia, Mixcloud, and DailyMotion. It is wrapped around the [ReactPlayer](https://github.com/cookpete/react-player) component. 14 | 15 | For more detailed documentation on Dash Player and how to use it, visit the official [Dash Player documentation page](https://dash.plotly.com/dash-player) 16 | 17 | For updates and more, please see the ongoing changes to this repository's issue tracker or the Dash community discussion on Dash Player. 18 | 19 | This is a custom community component, so if your organization or company is interested in sponsoring enhancements to this project, [please reach out to the Plotly Dash team](https://plot.ly/dash/pricing). 20 | 21 | ## Getting started 22 | 23 | Here are the following steps to get started with using Dash Player in your own Dash apps 24 | 25 | ```sh 26 | $ pip install dash-player 27 | ``` 28 | 29 | ## Documentation 30 | 31 | | Prop | Description | Default | 32 | | ----------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------- | 33 | | `id` | The ID used to identify this component in Dash callbacks. | 34 | | `className` | The CSS class used to identify this component in external stylesheets. | 35 | | `url` | The url of the media to be played. | 36 | | `playing` | Whether or not the media is currently playing. Can be set to `True` or `False` to play and pause the media, respectively. | `false` | 37 | | `loop` | Whether or not the media will loop once the player reaches the end. Can be set to `True` or `False` to set looping on or off, respectively. | `false` | 38 | | `controls` | Set to true or false to display native player controls. Vimeo, Twitch and Wistia player will always display controls. | `false` | 39 | | `volume` | A number between `0` and `1` representing the volume of the player. If set to None, Dash Player ises default volume on all players. | `null` | 40 | | `muted` | Set to true or false to mute or unmute player volume, respectively. Only works if volume is set. | `false` | 41 | | `playbackRate` | Set the playback rate of the player (only supported by YouTube, Wistia, and file paths). | 42 | | `width` | A number or string representing the pixel width of the player. | `640px` | 43 | | `height` | A number or string representing the pixel height of the player. | `360px` | 44 | | `style` | Optional additional CSS styles. If width or height are supplied within style, then this will override the component-level width or height. | `{}` | 45 | | `playsinline` | Applies the html5 playsinline attribute where supported, which allows videos to be played inline and will not automatically enter fullscreen mode when playback begins (for iOS). | `false` | 46 | | `currentTime` | Returns the number of seconds that have been played | 47 | | `secondsLoaded` | Returns the number of seconds that have been loaded | 48 | | `duration` | Returns the duration (in seconds) of the currently playing media | 49 | | `intervalCurrentTime` | Interval in milliseconds at which currentTime prop is updated. | `40` | 50 | | `intervalSecondsLoaded` | Interval in milliseconds at which secondsLoaded prop is updated. | `500` | 51 | | `intervalDuration` | Interval in milliseconds at which duration prop is updated. | `500` | 52 | | `seekTo` | Seek to the given number of seconds, or fraction if amount is between `0` and `1` | `null` | 53 | 54 | ## Built With 55 | 56 | - [Dash](https://dash.plot.ly/) - Main server and interactive components 57 | - [ReactPlayer](https://www.npmjs.com/package/react-player) - The react component that was wrapped by this 58 | 59 | ## Contributing 60 | 61 | Please read [CONTRIBUTING.md](CONTRIBUTING.md) for details on our code of conduct, and the process for submitting pull requests to us. 62 | 63 | ## Authors 64 | 65 | - **Xing Han** - _Initial Work_ - [@xhluca](https://github.com/xhluca) 66 | - **Alex Hsu** - _Maintainer/Ongoing Developer_ - [@alexshoe](https://github.com/alexshoe) 67 | - **Alex Johnson** - _Code Review_ - [@alexcjohnson](https://github.com/alexcjohnson) 68 | 69 | See also the list of [contributors](https://github.com/xhlulu/dash-player/contributors) who participated in this project. 70 | 71 | ## License 72 | 73 | This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details 74 | 75 | ## Partnership 76 | 77 | Changes to `dash-player` were sponsored by Volkswagen's Center of Excellence for Battery Systems. 78 | 79 |

80 | 81 |

82 | -------------------------------------------------------------------------------- /_validate_init.py: -------------------------------------------------------------------------------- 1 | """ 2 | DO NOT MODIFY 3 | This file is used to validate your publish settings. 4 | """ 5 | from __future__ import print_function 6 | 7 | import os 8 | import sys 9 | import importlib 10 | 11 | 12 | components_package = "dash_player" 13 | 14 | components_lib = importlib.import_module(components_package) 15 | 16 | missing_dist_msg = "Warning {} was not found in `{}.__init__.{}`!!!" 17 | missing_manifest_msg = """ 18 | Warning {} was not found in `MANIFEST.in`! 19 | It will not be included in the build! 20 | """ 21 | 22 | with open("MANIFEST.in", "r") as f: 23 | manifest = f.read() 24 | 25 | 26 | def check_dist(dist, filename): 27 | # Support the dev bundle. 28 | if filename.endswith("dev.js"): 29 | return True 30 | 31 | return any( 32 | filename in x 33 | for d in dist 34 | for x in ( 35 | [d.get("relative_package_path")] 36 | if not isinstance(d.get("relative_package_path"), list) 37 | else d.get("relative_package_path") 38 | ) 39 | ) 40 | 41 | 42 | def check_manifest(filename): 43 | return filename in manifest 44 | 45 | 46 | def check_file(dist, filename): 47 | if not check_dist(dist, filename): 48 | print( 49 | missing_dist_msg.format(filename, components_package, "_js_dist"), 50 | file=sys.stderr, 51 | ) 52 | if not check_manifest(filename): 53 | print(missing_manifest_msg.format(filename), file=sys.stderr) 54 | 55 | 56 | for cur, _, files in os.walk(components_package): 57 | for f in files: 58 | 59 | if f.endswith("js"): 60 | # noinspection PyProtectedMember 61 | check_file(components_lib._js_dist, f) 62 | elif f.endswith("css"): 63 | # noinspection PyProtectedMember 64 | check_file(components_lib._css_dist, f) 65 | elif not f.endswith("py"): 66 | check_manifest(f) 67 | -------------------------------------------------------------------------------- /dash-info.yaml: -------------------------------------------------------------------------------- 1 | pkg_help_description: > 2 | Dash Player is a dash component for playing a variety of URLs, including file paths, YouTube, Facebook, Twitch, SoundCloud, Streamable, Vimeo, Wistia, Mixcloud, and DailyMotion. It is wrapped around the react-player component. 3 | pkg_help_title: > 4 | Interactive Media Player Component for Dash 5 | -------------------------------------------------------------------------------- /dash_player/DashPlayer.py: -------------------------------------------------------------------------------- 1 | # AUTO GENERATED FILE - DO NOT EDIT 2 | 3 | from dash.development.base_component import Component, _explicitize_args 4 | 5 | 6 | class DashPlayer(Component): 7 | """A DashPlayer component. 8 | A Dash component for playing a variety of URLs, including file paths, 9 | YouTube, Facebook, Twitch, SoundCloud, Streamable, Vimeo, Wistia, Mixcloud, 10 | and DailyMotion. 11 | 12 | Keyword arguments: 13 | 14 | - id (string; optional): 15 | The ID used to identify this component in Dash callbacks. 16 | 17 | - className (string; optional): 18 | Used to identify the CSS class of the Dash Player component. 19 | 20 | - controls (boolean; default False): 21 | Set to True or False to display native player controls Vimeo, 22 | Twitch and Wistia player will always display controls. 23 | 24 | - currentTime (number; optional): 25 | Returns the number of seconds that have been played. 26 | 27 | - duration (number; optional): 28 | Returns the duration (in seconds) of the currently playing media. 29 | 30 | - height (string; default '360px'): 31 | A number or string representing the pixel height of the player. 32 | 33 | - intervalCurrentTime (number; default 100): 34 | Interval in milliseconds at which currentTime prop is updated. 35 | 36 | - intervalDuration (number; default 500): 37 | Interval in milliseconds at which duration prop is updated. 38 | 39 | - intervalSecondsLoaded (number; default 500): 40 | Interval in milliseconds at which secondsLoaded prop is updated. 41 | 42 | - loop (boolean; default False): 43 | Whether or not the media will loop once the player reaches the 44 | end. Can be set to True or False to set looping on or off, 45 | respectively. 46 | 47 | - muted (boolean; default False): 48 | Set to True or False to mute or unmute player volume, 49 | respectively. Only works if volume is set. 50 | 51 | - playbackRate (number; default 1): 52 | Set the playback rate of the player Only supported by YouTube, 53 | Wistia, and file paths. 54 | 55 | - playing (boolean; default False): 56 | Whether or not the media is currently playing. Can be set to True 57 | or False to play and pause the media, respectively. 58 | 59 | - playsinline (boolean; default False): 60 | Applies the html5 playsinline attribute where supported, which 61 | allows videos to be played inline and will not automatically enter 62 | fullscreen mode when playback begins (for iOS). 63 | 64 | - secondsLoaded (number; optional): 65 | Returns the number of seconds that have been loaded. 66 | 67 | - seekTo (number; optional): 68 | Seek to the given number of seconds, or fraction if amount is 69 | between 0 and 1. 70 | 71 | - style (dict; optional): 72 | Optional additional CSS styles. If width or height are supplied 73 | within style, then this will override the component-level width or 74 | height. 75 | 76 | - url (string; optional): 77 | The url of the media to be played. 78 | 79 | - volume (number; optional): 80 | A number between 0 and 1 representing the volume of the player. If 81 | set to None, Dash Player ises default volume on all players. 82 | 83 | - width (string; default '640px'): 84 | A number or string representing the pixel width of the player.""" 85 | _children_props = [] 86 | _base_nodes = ['children'] 87 | _namespace = 'dash_player' 88 | _type = 'DashPlayer' 89 | @_explicitize_args 90 | def __init__(self, id=Component.UNDEFINED, className=Component.UNDEFINED, url=Component.UNDEFINED, playing=Component.UNDEFINED, loop=Component.UNDEFINED, controls=Component.UNDEFINED, volume=Component.UNDEFINED, muted=Component.UNDEFINED, playbackRate=Component.UNDEFINED, width=Component.UNDEFINED, height=Component.UNDEFINED, style=Component.UNDEFINED, playsinline=Component.UNDEFINED, currentTime=Component.UNDEFINED, secondsLoaded=Component.UNDEFINED, duration=Component.UNDEFINED, intervalCurrentTime=Component.UNDEFINED, intervalSecondsLoaded=Component.UNDEFINED, intervalDuration=Component.UNDEFINED, seekTo=Component.UNDEFINED, **kwargs): 91 | self._prop_names = ['id', 'className', 'controls', 'currentTime', 'duration', 'height', 'intervalCurrentTime', 'intervalDuration', 'intervalSecondsLoaded', 'loop', 'muted', 'playbackRate', 'playing', 'playsinline', 'secondsLoaded', 'seekTo', 'style', 'url', 'volume', 'width'] 92 | self._valid_wildcard_attributes = [] 93 | self.available_properties = ['id', 'className', 'controls', 'currentTime', 'duration', 'height', 'intervalCurrentTime', 'intervalDuration', 'intervalSecondsLoaded', 'loop', 'muted', 'playbackRate', 'playing', 'playsinline', 'secondsLoaded', 'seekTo', 'style', 'url', 'volume', 'width'] 94 | self.available_wildcard_properties = [] 95 | _explicit_args = kwargs.pop('_explicit_args') 96 | _locals = locals() 97 | _locals.update(kwargs) # For wildcard attrs and excess named props 98 | args = {k: _locals[k] for k in _explicit_args} 99 | 100 | super(DashPlayer, self).__init__(**args) 101 | -------------------------------------------------------------------------------- /dash_player/__init__.py: -------------------------------------------------------------------------------- 1 | from __future__ import print_function as _ 2 | 3 | import os as _os 4 | import sys as _sys 5 | import json 6 | 7 | import dash as _dash 8 | 9 | # noinspection PyUnresolvedReferences 10 | from ._imports_ import * 11 | from ._imports_ import __all__ 12 | 13 | if not hasattr(_dash, "development"): 14 | print( 15 | "Dash was not successfully imported. " 16 | "Make sure you don't have a file " 17 | 'named \n"dash.py" in your current directory.', 18 | file=_sys.stderr, 19 | ) 20 | _sys.exit(1) 21 | 22 | _basepath = _os.path.dirname(__file__) 23 | _filepath = _os.path.abspath(_os.path.join(_basepath, "package.json")) 24 | with open(_filepath) as f: 25 | package = json.load(f) 26 | 27 | __version__ = package["version"] 28 | 29 | _current_path = _os.path.dirname(_os.path.abspath(__file__)) 30 | 31 | _this_module = _sys.modules[__name__] 32 | 33 | 34 | _js_dist = [ 35 | { 36 | "relative_package_path": "dash_player.min.js", 37 | "namespace": "dash_player", 38 | "external_url": ( 39 | "https://unpkg.com/@plotly/dash-player@{}" "/dash_player/dash_player.min.js" 40 | ).format(__version__), 41 | }, 42 | { 43 | "relative_package_path": "dash_player.min.js.map", 44 | "namespace": "dash_player", 45 | "external_url": ( 46 | "https://unpkg.com/@plotly/dash-player@{}" 47 | "/dash_player/dash_player.min.js.map" 48 | ).format(__version__), 49 | "dynamic": True, 50 | }, 51 | { 52 | "relative_package_path": "async-dashplayer.js", 53 | "namespace": "dash_player", 54 | "external_url": ( 55 | "https://unpkg.com/@plotly/dash-player@{}" 56 | "/dash_player/async-dashplayer.js" 57 | ).format(__version__), 58 | 'async': True 59 | }, 60 | { 61 | "relative_package_path": "async-dashplayer.js.map", 62 | "namespace": "dash_player", 63 | "external_url": ( 64 | "https://unpkg.com/@plotly/dash-player@{}" 65 | "/dash_player/async-dashplayer.js.map" 66 | ).format(__version__), 67 | 'dynamic': True 68 | }, 69 | ] 70 | 71 | _css_dist = [] 72 | 73 | 74 | for _component in __all__: 75 | setattr(locals()[_component], "_js_dist", _js_dist) 76 | setattr(locals()[_component], "_css_dist", _css_dist) 77 | -------------------------------------------------------------------------------- /dash_player/_imports_.py: -------------------------------------------------------------------------------- 1 | from .DashPlayer import DashPlayer 2 | 3 | __all__ = [ 4 | "DashPlayer" 5 | ] -------------------------------------------------------------------------------- /dash_player/dash_player.min.js: -------------------------------------------------------------------------------- 1 | (()=>{var e,t,r={908:(e,t,r)=>{"use strict";r.d(t,{ZP:()=>f,iG:()=>d,lG:()=>y});var n=r(196),o=r.n(n),i=r(697),a=r.n(i);function u(e){return u="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},u(e)}function c(e,t){for(var r=0;r{"use strict";var n=r(414);function o(){}function i(){}i.resetWarningCache=o,e.exports=function(){function e(e,t,r,o,i,a){if(a!==n){var u=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw u.name="Invariant Violation",u}}function t(){return e}e.isRequired=e;var r={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:i,resetWarningCache:o};return r.PropTypes=r,r}},697:(e,t,r)=>{e.exports=r(703)()},414:e=>{"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},196:e=>{"use strict";e.exports=window.React}},n={};function o(e){var t=n[e];if(void 0!==t)return t.exports;var i=n[e]={exports:{}};return r[e](i,i.exports,o),i.exports}o.m=r,o.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return o.d(t,{a:t}),t},o.d=(e,t)=>{for(var r in t)o.o(t,r)&&!o.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},o.f={},o.e=e=>Promise.all(Object.keys(o.f).reduce(((t,r)=>(o.f[r](e,t),t)),[])),o.u=e=>"async-dashplayer.js",o.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),o.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),e={},t="dash_player:",o.l=(r,n,i,a)=>{if(e[r])e[r].push(n);else{var u,c;if(void 0!==i)for(var l=document.getElementsByTagName("script"),s=0;s{u.onerror=u.onload=null,clearTimeout(d);var o=e[r];if(delete e[r],u.parentNode&&u.parentNode.removeChild(u),o&&o.forEach((e=>e(n))),t)return t(n)},d=setTimeout(f.bind(null,void 0,{type:"timeout",target:u}),12e4);u.onerror=f.bind(null,u.onerror),u.onload=f.bind(null,u.onload),c&&document.head.appendChild(u)}},o.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},(()=>{var e;o.g.importScripts&&(e=o.g.location+"");var t=o.g.document;if(!e&&t&&(t.currentScript&&(e=t.currentScript.src),!e)){var r=t.getElementsByTagName("script");r.length&&(e=r[r.length-1].src)}if(!e)throw new Error("Automatic publicPath is not supported in this browser");e=e.replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),o.p=e})();var i,a=function(){var e=document.currentScript;if(!e){for(var t=document.getElementsByTagName("script"),r=[],n=0;n{var e={179:0};o.f.j=(t,r)=>{var n=o.o(e,t)?e[t]:void 0;if(0!==n)if(n)r.push(n[2]);else{var i=new Promise(((r,o)=>n=e[t]=[r,o]));r.push(n[2]=i);var a=o.p+o.u(t),u=new Error;o.l(a,(r=>{if(o.o(e,t)&&(0!==(n=e[t])&&(e[t]=void 0),n)){var i=r&&("load"===r.type?"missing":r.type),a=r&&r.target&&r.target.src;u.message="Loading chunk "+t+" failed.\n("+i+": "+a+")",u.name="ChunkLoadError",u.type=i,u.request=a,n[1](u)}}),"chunk-"+t,t)}};var t=(t,r)=>{var n,i,[a,u,c]=r,l=0;if(a.some((t=>0!==e[t]))){for(n in u)o.o(u,n)&&(o.m[n]=u[n]);c&&c(o)}for(t&&t(r);l{"use strict";o.r(c),o.d(c,{DashPlayer:()=>e.ZP});var e=o(908)})(),window.dash_player=c})(); 2 | //# sourceMappingURL=dash_player.min.js.map -------------------------------------------------------------------------------- /dash_player/dash_player.min.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"dash_player.min.js","mappings":"UAAIA,EACAC,E,+gCCEJ,IAAMC,GAAiBC,EAAAA,EAAAA,OAAK,kBAAM,4BAA4E,IAQzFC,EAAU,SAAAC,I,qRAAAC,CAAAF,EAAAC,GAAA,I,QAAAE,G,EAAAH,E,qrBAAA,SAAAA,IAAA,O,4FAAAI,CAAA,KAAAJ,GAAAG,EAAAE,MAAA,KAAAC,UAAA,CAO1B,O,EAP0BN,G,EAAA,EAAAO,IAAA,SAAAC,MAC3B,WACI,OACIC,IAAAA,cAACC,EAAAA,SAAQ,CAACC,SAAU,MAChBF,IAAAA,cAACX,EAAmBc,KAAKC,OAGrC,M,oEAACb,CAAA,CAP0B,CAASc,EAAAA,WAUxCd,EAAWe,aAAe,CACtBC,SAAS,EACTC,MAAM,EACNC,UAAU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KAAOC,EAAU,IAC1FF,EAAM7H,KAAO,iBACb6H,EAAMlC,KAAOmC,EACbD,EAAMI,QAAUF,EAChBN,EAAmB,GAAGI,EACvB,CACD,GAEwC,SAAWhF,EAASA,EAE/D,CACD,EAcF,IAAIqF,EAAuB,CAACC,EAA4BC,KACvD,IAGIzG,EAAUkB,GAHTwF,EAAUC,EAAaC,GAAWH,EAGhBhE,EAAI,EAC3B,GAAGiE,EAASG,MAAM9J,GAAgC,IAAxB6I,EAAgB7I,KAAa,CACtD,IAAIiD,KAAY2G,EACZ5G,EAAoBY,EAAEgG,EAAa3G,KACrCD,EAAoBK,EAAEJ,GAAY2G,EAAY3G,IAG7C4G,GAAsBA,EAAQ7G,EAClC,CAEA,IADGyG,GAA4BA,EAA2BC,GACrDhE,EAAIiE,EAAShE,OAAQD,IACzBvB,EAAUwF,EAASjE,GAChB1C,EAAoBY,EAAEiF,EAAiB1E,IAAY0E,EAAgB1E,IACrE0E,EAAgB1E,GAAS,KAE1B0E,EAAgB1E,GAAW,CAC5B,EAIG4F,EAAqBC,KAA8B,wBAAIA,KAA8B,yBAAK,GAC9FD,EAAmBlD,QAAQ2C,EAAqBxC,KAAK,KAAM,IAC3D+C,EAAmB3E,KAAOoE,EAAqBxC,KAAK,KAAM+C,EAAmB3E,KAAK4B,KAAK+C,G","sources":["webpack://dash_player/webpack/runtime/load script","webpack://dash_player/./src/lib/components/DashPlayer.react.js","webpack://dash_player/./node_modules/prop-types/factoryWithThrowingShims.js","webpack://dash_player/./node_modules/prop-types/index.js","webpack://dash_player/./node_modules/prop-types/lib/ReactPropTypesSecret.js","webpack://dash_player/external window \"React\"","webpack://dash_player/webpack/bootstrap","webpack://dash_player/webpack/runtime/compat get default export","webpack://dash_player/webpack/runtime/define property getters","webpack://dash_player/webpack/runtime/ensure chunk","webpack://dash_player/webpack/runtime/get javascript chunk filename","webpack://dash_player/webpack/runtime/global","webpack://dash_player/webpack/runtime/hasOwnProperty shorthand","webpack://dash_player/webpack/runtime/make namespace object","webpack://dash_player/webpack/runtime/publicPath","webpack://dash_player/webpack/runtime/compat","webpack://dash_player/webpack/runtime/jsonp chunk loading"],"sourcesContent":["var inProgress = {};\nvar dataWebpackPrefix = \"dash_player:\";\n// loadScript function to load a script via script tag\n__webpack_require__.l = (url, done, key, chunkId) => {\n\tif(inProgress[url]) { inProgress[url].push(done); return; }\n\tvar script, needAttach;\n\tif(key !== undefined) {\n\t\tvar scripts = document.getElementsByTagName(\"script\");\n\t\tfor(var i = 0; i < scripts.length; i++) {\n\t\t\tvar s = scripts[i];\n\t\t\tif(s.getAttribute(\"src\") == url || s.getAttribute(\"data-webpack\") == dataWebpackPrefix + key) { script = s; break; }\n\t\t}\n\t}\n\tif(!script) {\n\t\tneedAttach = true;\n\t\tscript = document.createElement('script');\n\n\t\tscript.charset = 'utf-8';\n\t\tscript.timeout = 120;\n\t\tif (__webpack_require__.nc) {\n\t\t\tscript.setAttribute(\"nonce\", __webpack_require__.nc);\n\t\t}\n\t\tscript.setAttribute(\"data-webpack\", dataWebpackPrefix + key);\n\t\tscript.src = url;\n\t}\n\tinProgress[url] = [done];\n\tvar onScriptComplete = (prev, event) => {\n\t\t// avoid mem leaks in IE.\n\t\tscript.onerror = script.onload = null;\n\t\tclearTimeout(timeout);\n\t\tvar doneFns = inProgress[url];\n\t\tdelete inProgress[url];\n\t\tscript.parentNode && script.parentNode.removeChild(script);\n\t\tdoneFns && doneFns.forEach((fn) => (fn(event)));\n\t\tif(prev) return prev(event);\n\t}\n\tvar timeout = setTimeout(onScriptComplete.bind(null, undefined, { type: 'timeout', target: script }), 120000);\n\tscript.onerror = onScriptComplete.bind(null, script.onerror);\n\tscript.onload = onScriptComplete.bind(null, script.onload);\n\tneedAttach && document.head.appendChild(script);\n};","import React, {Component, lazy, Suspense} from 'react';\nimport PropTypes from 'prop-types';\n\nconst RealDashPlayer = lazy(() => import(/* webpackChunkName: \"dashplayer\" */ '../fragments/DashPlayer.react'));\n\n/**\n * A Dash component for playing a variety of URLs, including file paths,\n * YouTube, Facebook, Twitch, SoundCloud, Streamable, Vimeo, Wistia, Mixcloud,\n * and DailyMotion.\n */\n\nexport default class DashPlayer extends Component {\n render() {\n return (\n \n \n \n );\n }\n}\n\nDashPlayer.defaultProps = {\n playing: false,\n loop: false,\n controls: false,\n volume: null,\n muted: false,\n playbackRate: 1,\n width: '640px',\n height: '360px',\n style:{},\n playsinline: false,\n seekTo: null,\n intervalCurrentTime: 100,\n intervalSecondsLoaded: 500,\n intervalDuration: 500\n};\n\nDashPlayer.propTypes = {\n /**\n * The ID used to identify this component in Dash callbacks.\n */\n id: PropTypes.string,\n\n /**\n * Used to identify the CSS class of the Dash Player component\n */\n className: PropTypes.string,\n\n /**\n * Dash-assigned callback that should be called whenever any of the\n * properties change\n */\n setProps: PropTypes.func,\n\n /**\n * The url of the media to be played.\n */\n url: PropTypes.string,\n\n /**\n * Whether or not the media is currently playing. Can be set to True\n * or False to play and pause the media, respectively.\n */\n playing: PropTypes.bool,\n\n /**\n * Whether or not the media will loop once the player reaches the end.\n * Can be set to True or False to set looping on or off, respectively.\n */\n loop: PropTypes.bool,\n\n /**\n * Set to true or false to display native player controls\n * Vimeo, Twitch and Wistia player will always display controls\n */\n controls: PropTypes.bool,\n\n /**\n * A number between 0 and 1 representing the volume of the player.\n * If set to None, Dash Player ises default volume on all players.\n */\n volume: PropTypes.number,\n\n /**\n * Set to true or false to mute or unmute player volume, respectively.\n * Only works if volume is set.\n */\n muted: PropTypes.bool,\n\n /**\n * Set the playback rate of the player\n * Only supported by YouTube, Wistia, and file paths.\n */\n playbackRate: PropTypes.number,\n\n /**\n * A number or string representing the pixel width of the player.\n */\n width: PropTypes.string,\n\n /**\n * A number or string representing the pixel height of the player.\n */\n height: PropTypes.string,\n\n /**\n * Optional additional CSS styles. If width or height are supplied within style,\n * then this will override the component-level width or height\n */\n style: PropTypes.object,\n\n /**\n * Applies the html5 playsinline attribute where supported, which allows\n * videos to be played inline and will not automatically enter fullscreen\n * mode when playback begins (for iOS).\n */\n playsinline: PropTypes.bool,\n\n // Below are instance Methods that are updated at a fixed intervals, and\n // used as a properties in dash callbacks.\n /**\n * Returns the number of seconds that have been played.\n */\n currentTime: PropTypes.number,\n\n /**\n * Returns the number of seconds that have been loaded.\n */\n secondsLoaded: PropTypes.number,\n\n /**\n * Returns the duration (in seconds) of the currently playing media.\n */\n duration: PropTypes.number,\n\n /**\n * Interval in milliseconds at which currentTime prop is updated.\n */\n intervalCurrentTime: PropTypes.number,\n\n /**\n * Interval in milliseconds at which secondsLoaded prop is updated.\n */\n intervalSecondsLoaded: PropTypes.number,\n\n /**\n * Interval in milliseconds at which duration prop is updated.\n */\n intervalDuration: PropTypes.number,\n\n /**\n * Seek to the given number of seconds, or fraction if amount is between 0 and 1\n */\n seekTo: PropTypes.number\n};\n\nexport const propTypes = DashPlayer.propTypes;\nexport const defaultProps = DashPlayer.defaultProps;","/**\n * Copyright (c) 2013-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n'use strict';\n\nvar ReactPropTypesSecret = require('./lib/ReactPropTypesSecret');\n\nfunction emptyFunction() {}\nfunction emptyFunctionWithReset() {}\nemptyFunctionWithReset.resetWarningCache = emptyFunction;\n\nmodule.exports = function() {\n function shim(props, propName, componentName, location, propFullName, secret) {\n if (secret === ReactPropTypesSecret) {\n // It is still safe when called from React.\n return;\n }\n var err = new Error(\n 'Calling PropTypes validators directly is not supported by the `prop-types` package. ' +\n 'Use PropTypes.checkPropTypes() to call them. ' +\n 'Read more at http://fb.me/use-check-prop-types'\n );\n err.name = 'Invariant Violation';\n throw err;\n };\n shim.isRequired = shim;\n function getShim() {\n return shim;\n };\n // Important!\n // Keep this list in sync with production version in `./factoryWithTypeCheckers.js`.\n var ReactPropTypes = {\n array: shim,\n bigint: shim,\n bool: shim,\n func: shim,\n number: shim,\n object: shim,\n string: shim,\n symbol: shim,\n\n any: shim,\n arrayOf: getShim,\n element: shim,\n elementType: shim,\n instanceOf: getShim,\n node: shim,\n objectOf: getShim,\n oneOf: getShim,\n oneOfType: getShim,\n shape: getShim,\n exact: getShim,\n\n checkPropTypes: emptyFunctionWithReset,\n resetWarningCache: emptyFunction\n };\n\n ReactPropTypes.PropTypes = ReactPropTypes;\n\n return ReactPropTypes;\n};\n","/**\n * Copyright (c) 2013-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nif (process.env.NODE_ENV !== 'production') {\n var ReactIs = require('react-is');\n\n // By explicitly using `prop-types` you are opting into new development behavior.\n // http://fb.me/prop-types-in-prod\n var throwOnDirectAccess = true;\n module.exports = require('./factoryWithTypeCheckers')(ReactIs.isElement, throwOnDirectAccess);\n} else {\n // By explicitly using `prop-types` you are opting into new production behavior.\n // http://fb.me/prop-types-in-prod\n module.exports = require('./factoryWithThrowingShims')();\n}\n","/**\n * Copyright (c) 2013-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n'use strict';\n\nvar ReactPropTypesSecret = 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED';\n\nmodule.exports = ReactPropTypesSecret;\n","module.exports = window[\"React\"];","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n// expose the modules object (__webpack_modules__)\n__webpack_require__.m = __webpack_modules__;\n\n","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = (module) => {\n\tvar getter = module && module.__esModule ?\n\t\t() => (module['default']) :\n\t\t() => (module);\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.f = {};\n// This file contains only the entry chunk.\n// The chunk loading function for additional chunks\n__webpack_require__.e = (chunkId) => {\n\treturn Promise.all(Object.keys(__webpack_require__.f).reduce((promises, key) => {\n\t\t__webpack_require__.f[key](chunkId, promises);\n\t\treturn promises;\n\t}, []));\n};","// This function allow to reference async chunks\n__webpack_require__.u = (chunkId) => {\n\t// return url for filenames based on template\n\treturn \"\" + \"async-dashplayer\" + \".js\";\n};","__webpack_require__.g = (function() {\n\tif (typeof globalThis === 'object') return globalThis;\n\ttry {\n\t\treturn this || new Function('return this')();\n\t} catch (e) {\n\t\tif (typeof window === 'object') return window;\n\t}\n})();","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","var scriptUrl;\nif (__webpack_require__.g.importScripts) scriptUrl = __webpack_require__.g.location + \"\";\nvar document = __webpack_require__.g.document;\nif (!scriptUrl && document) {\n\tif (document.currentScript)\n\t\tscriptUrl = document.currentScript.src;\n\tif (!scriptUrl) {\n\t\tvar scripts = document.getElementsByTagName(\"script\");\n\t\tif(scripts.length) scriptUrl = scripts[scripts.length - 1].src\n\t}\n}\n// When supporting browsers where an automatic publicPath is not supported you must specify an output.publicPath manually via configuration\n// or pass an empty string (\"\") and set the __webpack_public_path__ variable from your code to use your own logic.\nif (!scriptUrl) throw new Error(\"Automatic publicPath is not supported in this browser\");\nscriptUrl = scriptUrl.replace(/#.*$/, \"\").replace(/\\?.*$/, \"\").replace(/\\/[^\\/]+$/, \"/\");\n__webpack_require__.p = scriptUrl;","var getCurrentScript = function() {\n var script = document.currentScript;\n if (!script) {\n /* Shim for IE11 and below */\n /* Do not take into account async scripts and inline scripts */\n\n var doc_scripts = document.getElementsByTagName('script');\n var scripts = [];\n\n for (var i = 0; i < doc_scripts.length; i++) {\n scripts.push(doc_scripts[i]);\n }\n\n scripts = scripts.filter(function(s) { return !s.async && !s.text && !s.textContent; });\n script = scripts.slice(-1)[0];\n }\n\n return script;\n};\n\nvar isLocalScript = function(script) {\n return /\\/_dash-component-suites\\//.test(script.src);\n};\n\nObject.defineProperty(__webpack_require__, 'p', {\n get: (function () {\n var script = getCurrentScript();\n\n var url = script.src.split('/').slice(0, -1).join('/') + '/';\n\n return function() {\n return url;\n };\n })()\n});\n\nif (typeof jsonpScriptSrc !== 'undefined') {\n var __jsonpScriptSrc__ = jsonpScriptSrc;\n jsonpScriptSrc = function(chunkId) {\n var script = getCurrentScript();\n var isLocal = isLocalScript(script);\n\n var src = __jsonpScriptSrc__(chunkId);\n\n if(!isLocal) {\n return src;\n }\n\n var srcFragments = src.split('/');\n var fileFragments = srcFragments.slice(-1)[0].split('.');\n\n fileFragments.splice(1, 0, \"v1_1_0m1678992460\");\n srcFragments.splice(-1, 1, fileFragments.join('.'))\n\n return srcFragments.join('/');\n };\n}\n","// no baseURI\n\n// object to store loaded and loading chunks\n// undefined = chunk not loaded, null = chunk preloaded/prefetched\n// [resolve, reject, Promise] = chunk loading, 0 = chunk loaded\nvar installedChunks = {\n\t179: 0\n};\n\n__webpack_require__.f.j = (chunkId, promises) => {\n\t\t// JSONP chunk loading for javascript\n\t\tvar installedChunkData = __webpack_require__.o(installedChunks, chunkId) ? installedChunks[chunkId] : undefined;\n\t\tif(installedChunkData !== 0) { // 0 means \"already installed\".\n\n\t\t\t// a Promise means \"currently loading\".\n\t\t\tif(installedChunkData) {\n\t\t\t\tpromises.push(installedChunkData[2]);\n\t\t\t} else {\n\t\t\t\tif(true) { // all chunks have JS\n\t\t\t\t\t// setup Promise in chunk cache\n\t\t\t\t\tvar promise = new Promise((resolve, reject) => (installedChunkData = installedChunks[chunkId] = [resolve, reject]));\n\t\t\t\t\tpromises.push(installedChunkData[2] = promise);\n\n\t\t\t\t\t// start chunk loading\n\t\t\t\t\tvar url = __webpack_require__.p + __webpack_require__.u(chunkId);\n\t\t\t\t\t// create error before stack unwound to get useful stacktrace later\n\t\t\t\t\tvar error = new Error();\n\t\t\t\t\tvar loadingEnded = (event) => {\n\t\t\t\t\t\tif(__webpack_require__.o(installedChunks, chunkId)) {\n\t\t\t\t\t\t\tinstalledChunkData = installedChunks[chunkId];\n\t\t\t\t\t\t\tif(installedChunkData !== 0) installedChunks[chunkId] = undefined;\n\t\t\t\t\t\t\tif(installedChunkData) {\n\t\t\t\t\t\t\t\tvar errorType = event && (event.type === 'load' ? 'missing' : event.type);\n\t\t\t\t\t\t\t\tvar realSrc = event && event.target && event.target.src;\n\t\t\t\t\t\t\t\terror.message = 'Loading chunk ' + chunkId + ' failed.\\n(' + errorType + ': ' + realSrc + ')';\n\t\t\t\t\t\t\t\terror.name = 'ChunkLoadError';\n\t\t\t\t\t\t\t\terror.type = errorType;\n\t\t\t\t\t\t\t\terror.request = realSrc;\n\t\t\t\t\t\t\t\tinstalledChunkData[1](error);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t};\n\t\t\t\t\t__webpack_require__.l(url, loadingEnded, \"chunk-\" + chunkId, chunkId);\n\t\t\t\t} else installedChunks[chunkId] = 0;\n\t\t\t}\n\t\t}\n};\n\n// no prefetching\n\n// no preloaded\n\n// no HMR\n\n// no HMR manifest\n\n// no on chunks loaded\n\n// install a JSONP callback for chunk loading\nvar webpackJsonpCallback = (parentChunkLoadingFunction, data) => {\n\tvar [chunkIds, moreModules, runtime] = data;\n\t// add \"moreModules\" to the modules object,\n\t// then flag all \"chunkIds\" as loaded and fire callback\n\tvar moduleId, chunkId, i = 0;\n\tif(chunkIds.some((id) => (installedChunks[id] !== 0))) {\n\t\tfor(moduleId in moreModules) {\n\t\t\tif(__webpack_require__.o(moreModules, moduleId)) {\n\t\t\t\t__webpack_require__.m[moduleId] = moreModules[moduleId];\n\t\t\t}\n\t\t}\n\t\tif(runtime) var result = runtime(__webpack_require__);\n\t}\n\tif(parentChunkLoadingFunction) parentChunkLoadingFunction(data);\n\tfor(;i < chunkIds.length; i++) {\n\t\tchunkId = chunkIds[i];\n\t\tif(__webpack_require__.o(installedChunks, chunkId) && installedChunks[chunkId]) {\n\t\t\tinstalledChunks[chunkId][0]();\n\t\t}\n\t\tinstalledChunks[chunkId] = 0;\n\t}\n\n}\n\nvar chunkLoadingGlobal = self[\"webpackChunkdash_player\"] = self[\"webpackChunkdash_player\"] || [];\nchunkLoadingGlobal.forEach(webpackJsonpCallback.bind(null, 0));\nchunkLoadingGlobal.push = webpackJsonpCallback.bind(null, chunkLoadingGlobal.push.bind(chunkLoadingGlobal));"],"names":["inProgress","dataWebpackPrefix","RealDashPlayer","lazy","DashPlayer","_Component","_inherits","_super","_classCallCheck","apply","arguments","key","value","React","Suspense","fallback","this","props","Component","defaultProps","playing","loop","controls","volume","muted","playbackRate","width","height","style","playsinline","seekTo","intervalCurrentTime","intervalSecondsLoaded","intervalDuration","propTypes","id","PropTypes","className","setProps","url","currentTime","secondsLoaded","duration","ReactPropTypesSecret","emptyFunction","emptyFunctionWithReset","resetWarningCache","module","exports","shim","propName","componentName","location","propFullName","secret","err","Error","name","getShim","isRequired","ReactPropTypes","array","bigint","bool","func","number","object","string","symbol","any","arrayOf","element","elementType","instanceOf","node","objectOf","oneOf","oneOfType","shape","exact","checkPropTypes","window","__webpack_module_cache__","__webpack_require__","moduleId","cachedModule","undefined","__webpack_modules__","m","n","getter","__esModule","d","a","definition","o","Object","defineProperty","enumerable","get","f","e","chunkId","Promise","all","keys","reduce","promises","u","g","globalThis","Function","obj","prop","prototype","hasOwnProperty","call","l","done","push","script","needAttach","scripts","document","getElementsByTagName","i","length","s","getAttribute","createElement","charset","timeout","nc","setAttribute","src","onScriptComplete","prev","event","onerror","onload","clearTimeout","doneFns","parentNode","removeChild","forEach","fn","setTimeout","bind","type","target","head","appendChild","r","Symbol","toStringTag","scriptUrl","importScripts","currentScript","replace","p","getCurrentScript","doc_scripts","filter","async","text","textContent","slice","split","join","jsonpScriptSrc","__jsonpScriptSrc__","isLocal","test","srcFragments","fileFragments","splice","installedChunks","j","installedChunkData","promise","resolve","reject","error","errorType","realSrc","message","request","webpackJsonpCallback","parentChunkLoadingFunction","data","chunkIds","moreModules","runtime","some","chunkLoadingGlobal","self"],"sourceRoot":""} -------------------------------------------------------------------------------- /dash_player/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@plotly/dash-player", 3 | "version": "1.1.0", 4 | "description": "Dash player component for videos", 5 | "repository": { 6 | "type": "git", 7 | "url": "git://github.com/plotly/dash-player.git" 8 | }, 9 | "homepage": "https://github.com/plotly/dash-player", 10 | "bugs": { 11 | "url": "https://github.com/plotly/dash-player/issues" 12 | }, 13 | "main": "dash_player/dash_player.min.js", 14 | "author": "Xing Han Lu ", 15 | "maintainer": "Alex Hsu ", 16 | "license": "MIT", 17 | "dependencies": { 18 | "react-player": "2.12.0" 19 | }, 20 | "scripts": { 21 | "start": "webpack-serve ./webpack.serve.config.js --open", 22 | "validate-init": "python _validate_init.py", 23 | "build:js-dev": "webpack", 24 | "build:js": "webpack", 25 | "build:backends": "dash-generate-components ./src/lib/components dash-player --r-prefix ''", 26 | "build": "npm run build:js && npm run build:js-dev && npm run build:backends", 27 | "lint": "flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics && flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics", 28 | "test": "pytest" 29 | }, 30 | "devDependencies": { 31 | "@babel/core": "^7.21.0", 32 | "@babel/plugin-proposal-object-rest-spread": "^7.20.7", 33 | "@babel/plugin-syntax-dynamic-import": "^7.8.3", 34 | "@babel/preset-env": "^7.20.2", 35 | "@babel/preset-react": "^7.18.6", 36 | "@plotly/webpack-dash-dynamic-import": "^1.3.0", 37 | "babel-eslint": "^10.0.2", 38 | "babel-loader": "^9.1.2", 39 | "copyfiles": "^2.4.1", 40 | "css-loader": "^6.7.3", 41 | "eslint": "^8.35.0", 42 | "eslint-config-prettier": "^8.7.0", 43 | "eslint-plugin-import": "^2.27.5", 44 | "eslint-plugin-react": "^7.32.2", 45 | "glob-parent": "6.0.2", 46 | "react-docgen": "^5.4.3", 47 | "style-loader": "^3.3.1", 48 | "styled-jsx": "^5.1.2", 49 | "webpack": "^5.76.0", 50 | "webpack-cli": "^5.0.1" 51 | }, 52 | "peerDependencies": { 53 | "react": ">=17", 54 | "react-dom": ">=17" 55 | }, 56 | "engines": { 57 | "node": "^16.17.0", 58 | "npm": "^8.15.0" 59 | } 60 | } 61 | -------------------------------------------------------------------------------- /index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | my-dash-component 5 | 6 | 7 |
8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /inst/deps/dash_player.min.js: -------------------------------------------------------------------------------- 1 | (()=>{var e,t,r={908:(e,t,r)=>{"use strict";r.d(t,{ZP:()=>f,iG:()=>d,lG:()=>y});var n=r(196),o=r.n(n),i=r(697),a=r.n(i);function u(e){return u="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},u(e)}function c(e,t){for(var r=0;r{"use strict";var n=r(414);function o(){}function i(){}i.resetWarningCache=o,e.exports=function(){function e(e,t,r,o,i,a){if(a!==n){var u=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw u.name="Invariant Violation",u}}function t(){return e}e.isRequired=e;var r={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:i,resetWarningCache:o};return r.PropTypes=r,r}},697:(e,t,r)=>{e.exports=r(703)()},414:e=>{"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},196:e=>{"use strict";e.exports=window.React}},n={};function o(e){var t=n[e];if(void 0!==t)return t.exports;var i=n[e]={exports:{}};return r[e](i,i.exports,o),i.exports}o.m=r,o.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return o.d(t,{a:t}),t},o.d=(e,t)=>{for(var r in t)o.o(t,r)&&!o.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},o.f={},o.e=e=>Promise.all(Object.keys(o.f).reduce(((t,r)=>(o.f[r](e,t),t)),[])),o.u=e=>"async-dashplayer.js",o.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),o.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),e={},t="dash_player:",o.l=(r,n,i,a)=>{if(e[r])e[r].push(n);else{var u,c;if(void 0!==i)for(var l=document.getElementsByTagName("script"),s=0;s{u.onerror=u.onload=null,clearTimeout(d);var o=e[r];if(delete e[r],u.parentNode&&u.parentNode.removeChild(u),o&&o.forEach((e=>e(n))),t)return t(n)},d=setTimeout(f.bind(null,void 0,{type:"timeout",target:u}),12e4);u.onerror=f.bind(null,u.onerror),u.onload=f.bind(null,u.onload),c&&document.head.appendChild(u)}},o.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},(()=>{var e;o.g.importScripts&&(e=o.g.location+"");var t=o.g.document;if(!e&&t&&(t.currentScript&&(e=t.currentScript.src),!e)){var r=t.getElementsByTagName("script");r.length&&(e=r[r.length-1].src)}if(!e)throw new Error("Automatic publicPath is not supported in this browser");e=e.replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),o.p=e})();var i,a=function(){var e=document.currentScript;if(!e){for(var t=document.getElementsByTagName("script"),r=[],n=0;n{var e={179:0};o.f.j=(t,r)=>{var n=o.o(e,t)?e[t]:void 0;if(0!==n)if(n)r.push(n[2]);else{var i=new Promise(((r,o)=>n=e[t]=[r,o]));r.push(n[2]=i);var a=o.p+o.u(t),u=new Error;o.l(a,(r=>{if(o.o(e,t)&&(0!==(n=e[t])&&(e[t]=void 0),n)){var i=r&&("load"===r.type?"missing":r.type),a=r&&r.target&&r.target.src;u.message="Loading chunk "+t+" failed.\n("+i+": "+a+")",u.name="ChunkLoadError",u.type=i,u.request=a,n[1](u)}}),"chunk-"+t,t)}};var t=(t,r)=>{var n,i,[a,u,c]=r,l=0;if(a.some((t=>0!==e[t]))){for(n in u)o.o(u,n)&&(o.m[n]=u[n]);c&&c(o)}for(t&&t(r);l{"use strict";o.r(c),o.d(c,{DashPlayer:()=>e.ZP});var e=o(908)})(),window.dash_player=c})(); 2 | //# sourceMappingURL=dash_player.min.js.map -------------------------------------------------------------------------------- /inst/deps/dash_player.min.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"dash_player.min.js","mappings":"UAAIA,EACAC,E,+gCCEJ,IAAMC,GAAiBC,EAAAA,EAAAA,OAAK,kBAAM,4BAA4E,IAQzFC,EAAU,SAAAC,I,qRAAAC,CAAAF,EAAAC,GAAA,I,QAAAE,G,EAAAH,E,qrBAAA,SAAAA,IAAA,O,4FAAAI,CAAA,KAAAJ,GAAAG,EAAAE,MAAA,KAAAC,UAAA,CAO1B,O,EAP0BN,G,EAAA,EAAAO,IAAA,SAAAC,MAC3B,WACI,OACIC,IAAAA,cAACC,EAAAA,SAAQ,CAACC,SAAU,MAChBF,IAAAA,cAACX,EAAmBc,KAAKC,OAGrC,M,oEAACb,CA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AMY,QAAUZ,EAAMY,OAAOf,IACpDgD,EAAMG,QAAU,iBAAmBnF,EAAU,cAAgBiF,EAAY,KAAOC,EAAU,IAC1FF,EAAM7H,KAAO,iBACb6H,EAAMlC,KAAOmC,EACbD,EAAMI,QAAUF,EAChBN,EAAmB,GAAGI,EACvB,CACD,GAEwC,SAAWhF,EAASA,EAE/D,CACD,EAcF,IAAIqF,EAAuB,CAACC,EAA4BC,KACvD,IAGIzG,EAAUkB,GAHTwF,EAAUC,EAAaC,GAAWH,EAGhBhE,EAAI,EAC3B,GAAGiE,EAASG,MAAM9J,GAAgC,IAAxB6I,EAAgB7I,KAAa,CACtD,IAAIiD,KAAY2G,EACZ5G,EAAoBY,EAAEgG,EAAa3G,KACrCD,EAAoBK,EAAEJ,GAAY2G,EAAY3G,IAG7C4G,GAAsBA,EAAQ7G,EAClC,CAEA,IADGyG,GAA4BA,EAA2BC,GACrDhE,EAAIiE,EAAShE,OAAQD,IACzBvB,EAAUwF,EAASjE,GAChB1C,EAAoBY,EAAEiF,EAAiB1E,IAAY0E,EAAgB1E,IACrE0E,EAAgB1E,GAAS,KAE1B0E,EAAgB1E,GAAW,CAC5B,EAIG4F,EAAqBC,KAA8B,wBAAIA,KAA8B,yBAAK,GAC9FD,EAAmBlD,QAAQ2C,EAAqBxC,KAAK,KAAM,IAC3D+C,EAAmB3E,KAAOoE,EAAqBxC,KAAK,KAAM+C,EAAmB3E,KAAK4B,KAAK+C,G","sources":["webpack://dash_player/webpack/runtime/load script","webpack://dash_player/./src/lib/components/DashPlayer.react.js","webpack://dash_player/./node_modules/prop-types/factoryWithThrowingShims.js","webpack://dash_player/./node_modules/prop-types/index.js","webpack://dash_player/./node_modules/prop-types/lib/ReactPropTypesSecret.js","webpack://dash_player/external window \"React\"","webpack://dash_player/webpack/bootstrap","webpack://dash_player/webpack/runtime/compat get default export","webpack://dash_player/webpack/runtime/define property getters","webpack://dash_player/webpack/runtime/ensure chunk","webpack://dash_player/webpack/runtime/get javascript chunk filename","webpack://dash_player/webpack/runtime/global","webpack://dash_player/webpack/runtime/hasOwnProperty shorthand","webpack://dash_player/webpack/runtime/make namespace object","webpack://dash_player/webpack/runtime/publicPath","webpack://dash_player/webpack/runtime/compat","webpack://dash_player/webpack/runtime/jsonp chunk loading"],"sourcesContent":["var inProgress = {};\nvar dataWebpackPrefix = \"dash_player:\";\n// loadScript function to load a script via script tag\n__webpack_require__.l = (url, done, key, chunkId) => {\n\tif(inProgress[url]) { inProgress[url].push(done); return; }\n\tvar script, needAttach;\n\tif(key !== undefined) {\n\t\tvar scripts = document.getElementsByTagName(\"script\");\n\t\tfor(var i = 0; i < scripts.length; i++) {\n\t\t\tvar s = scripts[i];\n\t\t\tif(s.getAttribute(\"src\") == url || s.getAttribute(\"data-webpack\") == dataWebpackPrefix + key) { script = s; break; }\n\t\t}\n\t}\n\tif(!script) {\n\t\tneedAttach = true;\n\t\tscript = document.createElement('script');\n\n\t\tscript.charset = 'utf-8';\n\t\tscript.timeout = 120;\n\t\tif (__webpack_require__.nc) {\n\t\t\tscript.setAttribute(\"nonce\", __webpack_require__.nc);\n\t\t}\n\t\tscript.setAttribute(\"data-webpack\", dataWebpackPrefix + key);\n\t\tscript.src = url;\n\t}\n\tinProgress[url] = [done];\n\tvar onScriptComplete = (prev, event) => {\n\t\t// avoid mem leaks in IE.\n\t\tscript.onerror = script.onload = null;\n\t\tclearTimeout(timeout);\n\t\tvar doneFns = inProgress[url];\n\t\tdelete inProgress[url];\n\t\tscript.parentNode && script.parentNode.removeChild(script);\n\t\tdoneFns && doneFns.forEach((fn) => (fn(event)));\n\t\tif(prev) return prev(event);\n\t}\n\tvar timeout = setTimeout(onScriptComplete.bind(null, undefined, { type: 'timeout', target: script }), 120000);\n\tscript.onerror = onScriptComplete.bind(null, script.onerror);\n\tscript.onload = onScriptComplete.bind(null, script.onload);\n\tneedAttach && document.head.appendChild(script);\n};","import React, {Component, lazy, Suspense} from 'react';\nimport PropTypes from 'prop-types';\n\nconst RealDashPlayer = lazy(() => import(/* webpackChunkName: \"dashplayer\" */ '../fragments/DashPlayer.react'));\n\n/**\n * A Dash component for playing a variety of URLs, including file paths,\n * YouTube, Facebook, Twitch, SoundCloud, Streamable, Vimeo, Wistia, Mixcloud,\n * and DailyMotion.\n */\n\nexport default class DashPlayer extends Component {\n render() {\n return (\n \n \n \n );\n }\n}\n\nDashPlayer.defaultProps = {\n playing: false,\n loop: false,\n controls: false,\n volume: null,\n muted: false,\n playbackRate: 1,\n width: '640px',\n height: '360px',\n style:{},\n playsinline: false,\n seekTo: null,\n intervalCurrentTime: 100,\n intervalSecondsLoaded: 500,\n intervalDuration: 500\n};\n\nDashPlayer.propTypes = {\n /**\n * The ID used to identify this component in Dash callbacks.\n */\n id: PropTypes.string,\n\n /**\n * Used to identify the CSS class of the Dash Player component\n */\n className: PropTypes.string,\n\n /**\n * Dash-assigned callback that should be called whenever any of the\n * properties change\n */\n setProps: PropTypes.func,\n\n /**\n * The url of the media to be played.\n */\n url: PropTypes.string,\n\n /**\n * Whether or not the media is currently playing. Can be set to True\n * or False to play and pause the media, respectively.\n */\n playing: PropTypes.bool,\n\n /**\n * Whether or not the media will loop once the player reaches the end.\n * Can be set to True or False to set looping on or off, respectively.\n */\n loop: PropTypes.bool,\n\n /**\n * Set to true or false to display native player controls\n * Vimeo, Twitch and Wistia player will always display controls\n */\n controls: PropTypes.bool,\n\n /**\n * A number between 0 and 1 representing the volume of the player.\n * If set to None, Dash Player ises default volume on all players.\n */\n volume: PropTypes.number,\n\n /**\n * Set to true or false to mute or unmute player volume, respectively.\n * Only works if volume is set.\n */\n muted: PropTypes.bool,\n\n /**\n * Set the playback rate of the player\n * Only supported by YouTube, Wistia, and file paths.\n */\n playbackRate: PropTypes.number,\n\n /**\n * A number or string representing the pixel width of the player.\n */\n width: PropTypes.string,\n\n /**\n * A number or string representing the pixel height of the player.\n */\n height: PropTypes.string,\n\n /**\n * Optional additional CSS styles. If width or height are supplied within style,\n * then this will override the component-level width or height\n */\n style: PropTypes.object,\n\n /**\n * Applies the html5 playsinline attribute where supported, which allows\n * videos to be played inline and will not automatically enter fullscreen\n * mode when playback begins (for iOS).\n */\n playsinline: PropTypes.bool,\n\n // Below are instance Methods that are updated at a fixed intervals, and\n // used as a properties in dash callbacks.\n /**\n * Returns the number of seconds that have been played.\n */\n currentTime: PropTypes.number,\n\n /**\n * Returns the number of seconds that have been loaded.\n */\n secondsLoaded: PropTypes.number,\n\n /**\n * Returns the duration (in seconds) of the currently playing media.\n */\n duration: PropTypes.number,\n\n /**\n * Interval in milliseconds at which currentTime prop is updated.\n */\n intervalCurrentTime: PropTypes.number,\n\n /**\n * Interval in milliseconds at which secondsLoaded prop is updated.\n */\n intervalSecondsLoaded: PropTypes.number,\n\n /**\n * Interval in milliseconds at which duration prop is updated.\n */\n intervalDuration: PropTypes.number,\n\n /**\n * Seek to the given number of seconds, or fraction if amount is between 0 and 1\n */\n seekTo: PropTypes.number\n};\n\nexport const propTypes = DashPlayer.propTypes;\nexport const defaultProps = DashPlayer.defaultProps;","/**\n * Copyright (c) 2013-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n'use strict';\n\nvar ReactPropTypesSecret = require('./lib/ReactPropTypesSecret');\n\nfunction emptyFunction() {}\nfunction emptyFunctionWithReset() {}\nemptyFunctionWithReset.resetWarningCache = emptyFunction;\n\nmodule.exports = function() {\n function shim(props, propName, componentName, location, propFullName, secret) {\n if (secret === ReactPropTypesSecret) {\n // It is still safe when called from React.\n return;\n }\n var err = new Error(\n 'Calling PropTypes validators directly is not supported by the `prop-types` package. ' +\n 'Use PropTypes.checkPropTypes() to call them. ' +\n 'Read more at http://fb.me/use-check-prop-types'\n );\n err.name = 'Invariant Violation';\n throw err;\n };\n shim.isRequired = shim;\n function getShim() {\n return shim;\n };\n // Important!\n // Keep this list in sync with production version in `./factoryWithTypeCheckers.js`.\n var ReactPropTypes = {\n array: shim,\n bigint: shim,\n bool: shim,\n func: shim,\n number: shim,\n object: shim,\n string: shim,\n symbol: shim,\n\n any: shim,\n arrayOf: getShim,\n element: shim,\n elementType: shim,\n instanceOf: getShim,\n node: shim,\n objectOf: getShim,\n oneOf: getShim,\n oneOfType: getShim,\n shape: getShim,\n exact: getShim,\n\n checkPropTypes: emptyFunctionWithReset,\n resetWarningCache: emptyFunction\n };\n\n ReactPropTypes.PropTypes = ReactPropTypes;\n\n return ReactPropTypes;\n};\n","/**\n * Copyright (c) 2013-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nif (process.env.NODE_ENV !== 'production') {\n var ReactIs = require('react-is');\n\n // By explicitly using `prop-types` you are opting into new development behavior.\n // http://fb.me/prop-types-in-prod\n var throwOnDirectAccess = true;\n module.exports = require('./factoryWithTypeCheckers')(ReactIs.isElement, throwOnDirectAccess);\n} else {\n // By explicitly using `prop-types` you are opting into new production behavior.\n // http://fb.me/prop-types-in-prod\n module.exports = require('./factoryWithThrowingShims')();\n}\n","/**\n * Copyright (c) 2013-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n'use strict';\n\nvar ReactPropTypesSecret = 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED';\n\nmodule.exports = ReactPropTypesSecret;\n","module.exports = window[\"React\"];","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n// expose the modules object (__webpack_modules__)\n__webpack_require__.m = __webpack_modules__;\n\n","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = (module) => {\n\tvar getter = module && module.__esModule ?\n\t\t() => (module['default']) :\n\t\t() => (module);\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.f = {};\n// This file contains only the entry chunk.\n// The chunk loading function for additional chunks\n__webpack_require__.e = (chunkId) => {\n\treturn Promise.all(Object.keys(__webpack_require__.f).reduce((promises, key) => {\n\t\t__webpack_require__.f[key](chunkId, promises);\n\t\treturn promises;\n\t}, []));\n};","// This function allow to reference async chunks\n__webpack_require__.u = (chunkId) => {\n\t// return url for filenames based on template\n\treturn \"\" + \"async-dashplayer\" + \".js\";\n};","__webpack_require__.g = (function() {\n\tif (typeof globalThis === 'object') return globalThis;\n\ttry {\n\t\treturn this || new Function('return this')();\n\t} catch (e) {\n\t\tif (typeof window === 'object') return window;\n\t}\n})();","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","var scriptUrl;\nif (__webpack_require__.g.importScripts) scriptUrl = __webpack_require__.g.location + \"\";\nvar document = __webpack_require__.g.document;\nif (!scriptUrl && document) {\n\tif (document.currentScript)\n\t\tscriptUrl = document.currentScript.src;\n\tif (!scriptUrl) {\n\t\tvar scripts = document.getElementsByTagName(\"script\");\n\t\tif(scripts.length) scriptUrl = scripts[scripts.length - 1].src\n\t}\n}\n// When supporting browsers where an automatic publicPath is not supported you must specify an output.publicPath manually via configuration\n// or pass an empty string (\"\") and set the __webpack_public_path__ variable from your code to use your own logic.\nif (!scriptUrl) throw new Error(\"Automatic publicPath is not supported in this browser\");\nscriptUrl = scriptUrl.replace(/#.*$/, \"\").replace(/\\?.*$/, \"\").replace(/\\/[^\\/]+$/, \"/\");\n__webpack_require__.p = scriptUrl;","var getCurrentScript = function() {\n var script = document.currentScript;\n if (!script) {\n /* Shim for IE11 and below */\n /* Do not take into account async scripts and inline scripts */\n\n var doc_scripts = document.getElementsByTagName('script');\n var scripts = [];\n\n for (var i = 0; i < doc_scripts.length; i++) {\n scripts.push(doc_scripts[i]);\n }\n\n scripts = scripts.filter(function(s) { return !s.async && !s.text && !s.textContent; });\n script = scripts.slice(-1)[0];\n }\n\n return script;\n};\n\nvar isLocalScript = function(script) {\n return /\\/_dash-component-suites\\//.test(script.src);\n};\n\nObject.defineProperty(__webpack_require__, 'p', {\n get: (function () {\n var script = getCurrentScript();\n\n var url = script.src.split('/').slice(0, -1).join('/') + '/';\n\n return function() {\n return url;\n };\n })()\n});\n\nif (typeof jsonpScriptSrc !== 'undefined') {\n var __jsonpScriptSrc__ = jsonpScriptSrc;\n jsonpScriptSrc = function(chunkId) {\n var script = getCurrentScript();\n var isLocal = isLocalScript(script);\n\n var src = __jsonpScriptSrc__(chunkId);\n\n if(!isLocal) {\n return src;\n }\n\n var srcFragments = src.split('/');\n var fileFragments = srcFragments.slice(-1)[0].split('.');\n\n fileFragments.splice(1, 0, \"v1_1_0m1678992460\");\n srcFragments.splice(-1, 1, fileFragments.join('.'))\n\n return srcFragments.join('/');\n };\n}\n","// no baseURI\n\n// object to store loaded and loading chunks\n// undefined = chunk not loaded, null = chunk preloaded/prefetched\n// [resolve, reject, Promise] = chunk loading, 0 = chunk loaded\nvar installedChunks = {\n\t179: 0\n};\n\n__webpack_require__.f.j = (chunkId, promises) => {\n\t\t// JSONP chunk loading for javascript\n\t\tvar installedChunkData = __webpack_require__.o(installedChunks, chunkId) ? installedChunks[chunkId] : undefined;\n\t\tif(installedChunkData !== 0) { // 0 means \"already installed\".\n\n\t\t\t// a Promise means \"currently loading\".\n\t\t\tif(installedChunkData) {\n\t\t\t\tpromises.push(installedChunkData[2]);\n\t\t\t} else {\n\t\t\t\tif(true) { // all chunks have JS\n\t\t\t\t\t// setup Promise in chunk cache\n\t\t\t\t\tvar promise = new Promise((resolve, reject) => (installedChunkData = installedChunks[chunkId] = [resolve, reject]));\n\t\t\t\t\tpromises.push(installedChunkData[2] = promise);\n\n\t\t\t\t\t// start chunk loading\n\t\t\t\t\tvar url = __webpack_require__.p + __webpack_require__.u(chunkId);\n\t\t\t\t\t// create error before stack unwound to get useful stacktrace later\n\t\t\t\t\tvar error = new Error();\n\t\t\t\t\tvar loadingEnded = (event) => {\n\t\t\t\t\t\tif(__webpack_require__.o(installedChunks, chunkId)) {\n\t\t\t\t\t\t\tinstalledChunkData = installedChunks[chunkId];\n\t\t\t\t\t\t\tif(installedChunkData !== 0) installedChunks[chunkId] = undefined;\n\t\t\t\t\t\t\tif(installedChunkData) {\n\t\t\t\t\t\t\t\tvar errorType = event && (event.type === 'load' ? 'missing' : event.type);\n\t\t\t\t\t\t\t\tvar realSrc = event && event.target && event.target.src;\n\t\t\t\t\t\t\t\terror.message = 'Loading chunk ' + chunkId + ' failed.\\n(' + errorType + ': ' + realSrc + ')';\n\t\t\t\t\t\t\t\terror.name = 'ChunkLoadError';\n\t\t\t\t\t\t\t\terror.type = errorType;\n\t\t\t\t\t\t\t\terror.request = realSrc;\n\t\t\t\t\t\t\t\tinstalledChunkData[1](error);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t};\n\t\t\t\t\t__webpack_require__.l(url, loadingEnded, \"chunk-\" + chunkId, chunkId);\n\t\t\t\t} else installedChunks[chunkId] = 0;\n\t\t\t}\n\t\t}\n};\n\n// no prefetching\n\n// no preloaded\n\n// no HMR\n\n// no HMR manifest\n\n// no on chunks loaded\n\n// install a JSONP callback for chunk loading\nvar webpackJsonpCallback = (parentChunkLoadingFunction, data) => {\n\tvar [chunkIds, moreModules, runtime] = data;\n\t// add \"moreModules\" to the modules object,\n\t// then flag all \"chunkIds\" as loaded and fire callback\n\tvar moduleId, chunkId, i = 0;\n\tif(chunkIds.some((id) => (installedChunks[id] !== 0))) {\n\t\tfor(moduleId in moreModules) {\n\t\t\tif(__webpack_require__.o(moreModules, moduleId)) {\n\t\t\t\t__webpack_require__.m[moduleId] = moreModules[moduleId];\n\t\t\t}\n\t\t}\n\t\tif(runtime) var result = runtime(__webpack_require__);\n\t}\n\tif(parentChunkLoadingFunction) parentChunkLoadingFunction(data);\n\tfor(;i < chunkIds.length; i++) {\n\t\tchunkId = chunkIds[i];\n\t\tif(__webpack_require__.o(installedChunks, chunkId) && installedChunks[chunkId]) {\n\t\t\tinstalledChunks[chunkId][0]();\n\t\t}\n\t\tinstalledChunks[chunkId] = 0;\n\t}\n\n}\n\nvar chunkLoadingGlobal = self[\"webpackChunkdash_player\"] = self[\"webpackChunkdash_player\"] || [];\nchunkLoadingGlobal.forEach(webpackJsonpCallback.bind(null, 0));\nchunkLoadingGlobal.push = webpackJsonpCallback.bind(null, chunkLoadingGlobal.push.bind(chunkLoadingGlobal));"],"names":["inProgress","dataWebpackPrefix","RealDashPlayer","lazy","DashPlayer","_Component","_inherits","_super","_classCallCheck","apply","arguments","key","value","React","Suspense","fallback","this","props","Component","defaultProps","playing","loop","controls","volume","muted","playbackRate","width","height","style","playsinline","seekTo","intervalCurrentTime","intervalSecondsLoaded","intervalDuration","propTypes","id","PropTypes","className","setProps","url","currentTime","secondsLoaded","duration","ReactPropTypesSecret","emptyFunction","emptyFunctionWithReset","resetWarningCache","module","exports","shim","propName","componentName","location","propFullName","secret","err","Error","name","getShim","isRequired","ReactPropTypes","array","bigint","bool","func","number","object","string","symbol","any","arrayOf","element","elementType","instanceOf","node","objectOf","oneOf","oneOfType","shape","exact","checkPropTypes","window","__webpack_module_cache__","__webpack_require__","moduleId","cachedModule","undefined","__webpack_modules__","m","n","getter","__esModule","d","a","definition","o","Object","defineProperty","enumerable","get","f","e","chunkId","Promise","all","keys","reduce","promises","u","g","globalThis","Function","obj","prop","prototype","hasOwnProperty","call","l","done","push","script","needAttach","scripts","document","getElementsByTagName","i","length","s","getAttribute","createElement","charset","timeout","nc","setAttribute","src","onScriptComplete","prev","event","onerror","onload","clearTimeout","doneFns","parentNode","removeChild","forEach","fn","setTimeout","bind","type","target","head","appendChild","r","Symbol","toStringTag","scriptUrl","importScripts","currentScript","replace","p","getCurrentScript","doc_scripts","filter","async","text","textContent","slice","split","join","jsonpScriptSrc","__jsonpScriptSrc__","isLocal","test","srcFragments","fileFragments","splice","installedChunks","j","installedChunkData","promise","resolve","reject","error","errorType","realSrc","message","request","webpackJsonpCallback","parentChunkLoadingFunction","data","chunkIds","moreModules","runtime","some","chunkLoadingGlobal","self"],"sourceRoot":""} -------------------------------------------------------------------------------- /man/dashPlayer-package.Rd: -------------------------------------------------------------------------------- 1 | % Auto-generated: do not edit by hand 2 | \docType{package} 3 | \name{dashPlayer-package} 4 | \alias{dashPlayer} 5 | \title{Interactive Media Player Component for Dash 6 | } 7 | \description{ 8 | Dash Player is a dash component for playing a variety of URLs, including file paths, YouTube, Facebook, Twitch, SoundCloud, Streamable, Vimeo, Wistia, Mixcloud, and DailyMotion. It is wrapped around the react-player component. 9 | 10 | } 11 | \author{ 12 | \strong{Maintainer}: Alex Hsu 13 | } 14 | -------------------------------------------------------------------------------- /man/dashPlayer.Rd: -------------------------------------------------------------------------------- 1 | % Auto-generated: do not edit by hand 2 | \name{dashPlayer} 3 | 4 | \alias{dashPlayer} 5 | 6 | \title{DashPlayer component} 7 | 8 | \description{ 9 | A Dash component for playing a variety of URLs, including file paths, YouTube, Facebook, Twitch, SoundCloud, Streamable, Vimeo, Wistia, Mixcloud, and DailyMotion. 10 | } 11 | 12 | \usage{ 13 | dashPlayer(id=NULL, className=NULL, controls=NULL, currentTime=NULL, 14 | duration=NULL, height=NULL, intervalCurrentTime=NULL, 15 | intervalDuration=NULL, intervalSecondsLoaded=NULL, 16 | loop=NULL, muted=NULL, playbackRate=NULL, playing=NULL, 17 | playsinline=NULL, secondsLoaded=NULL, seekTo=NULL, 18 | style=NULL, url=NULL, volume=NULL, width=NULL) 19 | } 20 | 21 | \arguments{ 22 | \item{id}{Character. The ID used to identify this component in Dash callbacks.} 23 | 24 | \item{className}{Character. Used to identify the CSS class of the Dash Player component} 25 | 26 | \item{controls}{Logical. Set to true or false to display native player controls 27 | Vimeo, Twitch and Wistia player will always display controls} 28 | 29 | \item{currentTime}{Numeric. Returns the number of seconds that have been played.} 30 | 31 | \item{duration}{Numeric. Returns the duration (in seconds) of the currently playing media.} 32 | 33 | \item{height}{Character. A number or string representing the pixel height of the player.} 34 | 35 | \item{intervalCurrentTime}{Numeric. Interval in milliseconds at which currentTime prop is updated.} 36 | 37 | \item{intervalDuration}{Numeric. Interval in milliseconds at which duration prop is updated.} 38 | 39 | \item{intervalSecondsLoaded}{Numeric. Interval in milliseconds at which secondsLoaded prop is updated.} 40 | 41 | \item{loop}{Logical. Whether or not the media will loop once the player reaches the end. 42 | Can be set to True or False to set looping on or off, respectively.} 43 | 44 | \item{muted}{Logical. Set to true or false to mute or unmute player volume, respectively. 45 | Only works if volume is set.} 46 | 47 | \item{playbackRate}{Numeric. Set the playback rate of the player 48 | Only supported by YouTube, Wistia, and file paths.} 49 | 50 | \item{playing}{Logical. Whether or not the media is currently playing. Can be set to True 51 | or False to play and pause the media, respectively.} 52 | 53 | \item{playsinline}{Logical. Applies the html5 playsinline attribute where supported, which allows 54 | videos to be played inline and will not automatically enter fullscreen 55 | mode when playback begins (for iOS).} 56 | 57 | \item{secondsLoaded}{Numeric. Returns the number of seconds that have been loaded.} 58 | 59 | \item{seekTo}{Numeric. Seek to the given number of seconds, or fraction if amount is between 0 and 1} 60 | 61 | \item{style}{Named list. Optional additional CSS styles. If width or height are supplied within style, 62 | then this will override the component-level width or height} 63 | 64 | \item{url}{Character. The url of the media to be played.} 65 | 66 | \item{volume}{Numeric. A number between 0 and 1 representing the volume of the player. 67 | If set to None, Dash Player ises default volume on all players.} 68 | 69 | \item{width}{Character. A number or string representing the pixel width of the player.} 70 | } 71 | 72 | \value{named list of JSON elements corresponding to React.js properties and their values} 73 | 74 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@plotly/dash-player", 3 | "version": "1.1.0", 4 | "description": "Dash player component for videos", 5 | "repository": { 6 | "type": "git", 7 | "url": "git://github.com/plotly/dash-player.git" 8 | }, 9 | "homepage": "https://github.com/plotly/dash-player", 10 | "bugs": { 11 | "url": "https://github.com/plotly/dash-player/issues" 12 | }, 13 | "main": "dash_player/dash_player.min.js", 14 | "author": "Xing Han Lu ", 15 | "maintainer": "Alex Hsu ", 16 | "license": "MIT", 17 | "dependencies": { 18 | "react-player": "2.12.0" 19 | }, 20 | "scripts": { 21 | "start": "webpack-serve ./webpack.serve.config.js --open", 22 | "validate-init": "python _validate_init.py", 23 | "build:js-dev": "webpack", 24 | "build:js": "webpack", 25 | "build:backends": "dash-generate-components ./src/lib/components dash-player --r-prefix ''", 26 | "build": "npm run build:js && npm run build:js-dev && npm run build:backends", 27 | "lint": "flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics && flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics", 28 | "test": "pytest" 29 | }, 30 | "devDependencies": { 31 | "@babel/core": "^7.21.0", 32 | "@babel/plugin-proposal-object-rest-spread": "^7.20.7", 33 | "@babel/plugin-syntax-dynamic-import": "^7.8.3", 34 | "@babel/preset-env": "^7.20.2", 35 | "@babel/preset-react": "^7.18.6", 36 | "@plotly/webpack-dash-dynamic-import": "^1.3.0", 37 | "babel-eslint": "^10.0.2", 38 | "babel-loader": "^9.1.2", 39 | "copyfiles": "^2.4.1", 40 | "css-loader": "^6.7.3", 41 | "eslint": "^8.35.0", 42 | "eslint-config-prettier": "^8.7.0", 43 | "eslint-plugin-import": "^2.27.5", 44 | "eslint-plugin-react": "^7.32.2", 45 | "glob-parent": "6.0.2", 46 | "react-docgen": "^5.4.3", 47 | "style-loader": "^3.3.1", 48 | "styled-jsx": "^5.1.2", 49 | "webpack": "^5.76.0", 50 | "webpack-cli": "^5.0.1" 51 | }, 52 | "peerDependencies": { 53 | "react": ">=17", 54 | "react-dom": ">=17" 55 | }, 56 | "engines": { 57 | "node": "^16.17.0", 58 | "npm": "^8.15.0" 59 | } 60 | } 61 | -------------------------------------------------------------------------------- /requirements-dev.txt: -------------------------------------------------------------------------------- 1 | dash[ci,dev,testing]==2.9.0 2 | -------------------------------------------------------------------------------- /requirements.txt: -------------------------------------------------------------------------------- 1 | # dash is required to call `build:py` 2 | dash>=0.31.0 3 | dash-html-components 4 | pyyaml -------------------------------------------------------------------------------- /review_checklist.md: -------------------------------------------------------------------------------- 1 | # Code Review Checklist 2 | 3 | ## Code quality & design 4 | 5 | - Is your code clear? If you had to go back to it in a month, would you be happy to? If someone else had to contribute to it, would they be able to? 6 | 7 | A few suggestions: 8 | 9 | - Make your variable names descriptive and use the same naming conventions throughout the code. 10 | 11 | - For more complex pieces of logic, consider putting a comment, and maybe an example. 12 | 13 | - In the comments, focus on describing _why_ the code does what it does, rather than describing _what_ it does. The reader can most likely read the code, but not necessarily understand why it was necessary. 14 | 15 | - Don't overdo it in the comments. The code should be clear enough to speak for itself. Stale comments that no longer reflect the intent of the code can hurt code comprehension. 16 | 17 | * Don't repeat yourself. Any time you see that the same piece of logic can be applied in multiple places, factor it out into a function, or variable, and reuse that code. 18 | * Scan your code for expensive operations (large computations, DOM queries, React re-renders). Have you done your possible to limit their impact? If not, it is going to slow your app down. 19 | * Can you think of cases where your current code will break? How are you handling errors? Should the user see them as notifications? Should your app try to auto-correct them for them? 20 | 21 | ## Component API 22 | 23 | - Have you tested your component on the Python side by creating an app in `usage.py` ? 24 | 25 | Do all of your component's props work when set from the back-end? 26 | 27 | Should all of them be settable from the back-end or are some only relevant to user interactions in the front-end? 28 | 29 | - Have you provided some basic documentation about your component? The Dash community uses [react docstrings](https://github.com/plotly/dash-docs/blob/master/tutorial/plugins.py#L45) to provide basic information about dash components. Take a look at this [Checklist component example](https://github.com/plotly/dash-core-components/blob/master/src/components/Checklist.react.js) and others from the dash-core-components repository. 30 | 31 | At a minimum, you should describe what your component does, and describe its props and the features they enable. 32 | 33 | Be careful to use the correct formatting for your docstrings for them to be properly recognized. 34 | 35 | ## Tests 36 | 37 | - The Dash team uses integration tests extensively, and we highly encourage you to write tests for the main functionality of your component. In the `tests` folder of the boilerplate, you can see a sample integration test. By launching it, you will run a sample Dash app in a browser. You can run the test with: 38 | ``` 39 | python -m tests.test_render 40 | ``` 41 | [Browse the Dash component code on GitHub for more examples of testing.](https://github.com/plotly/dash-core-components) 42 | 43 | ## Ready to publish? Final scan 44 | 45 | - Take a last look at the external resources that your component is using. Are all the external resources used [referenced in `MANIFEST.in`](https://github.com/plotly/dash-docs/blob/0b2fd8f892db720a7f3dc1c404b4cff464b5f8d4/tutorial/plugins.py#L55)? 46 | 47 | - [You're ready to publish!](https://github.com/plotly/dash-component-boilerplate/blob/master/%7B%7Bcookiecutter.project_shortname%7D%7D/README.md#create-a-production-build-and-publish) 48 | -------------------------------------------------------------------------------- /setup.py: -------------------------------------------------------------------------------- 1 | import io 2 | import json 3 | import os 4 | from setuptools import setup 5 | 6 | 7 | with open(os.path.join("dash_player", "package.json")) as f: 8 | package = json.load(f) 9 | 10 | package_name = package["name"].replace("@plotly/", "").replace("-", "_") 11 | 12 | setup( 13 | name=package_name, 14 | version=package["version"], 15 | author=package["author"], 16 | packages=[package_name], 17 | include_package_data=True, 18 | license=package["license"], 19 | description=("A Dash component for playing a variety of URLs."), 20 | long_description=io.open("README.md", encoding="utf-8").read(), 21 | long_description_content_type="text/markdown", 22 | python_requires=">=3.6", 23 | url="https://github.com/plotly/dash-player", 24 | install_requires=["dash>=1.6.1"], 25 | classifiers=[ 26 | "Programming Language :: Python :: 3", 27 | "Framework :: Dash", 28 | "License :: OSI Approved :: MIT License", 29 | "Operating System :: OS Independent", 30 | ], 31 | ) 32 | -------------------------------------------------------------------------------- /src/demo/App.js: -------------------------------------------------------------------------------- 1 | /* eslint no-magic-numbers: 0 */ 2 | import React, {Component} from 'react'; 3 | 4 | import { DashPlayer } from '../lib'; 5 | 6 | class App extends Component { 7 | 8 | constructor() { 9 | super(); 10 | this.state = { 11 | value: '' 12 | }; 13 | this.setProps = this.setProps.bind(this); 14 | } 15 | 16 | setProps(newProps) { 17 | this.setState(newProps); 18 | } 19 | 20 | render() { 21 | return ( 22 |
23 | 27 |
28 | ) 29 | } 30 | } 31 | 32 | export default App; 33 | -------------------------------------------------------------------------------- /src/demo/index.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import ReactDOM from 'react-dom'; 3 | import App from './App'; 4 | 5 | ReactDOM.render(, document.getElementById('root')); 6 | -------------------------------------------------------------------------------- /src/lib/components/DashPlayer.react.js: -------------------------------------------------------------------------------- 1 | import React, {Component, lazy, Suspense} from 'react'; 2 | import PropTypes from 'prop-types'; 3 | 4 | const RealDashPlayer = lazy(() => import(/* webpackChunkName: "dashplayer" */ '../fragments/DashPlayer.react')); 5 | 6 | /** 7 | * A Dash component for playing a variety of URLs, including file paths, 8 | * YouTube, Facebook, Twitch, SoundCloud, Streamable, Vimeo, Wistia, Mixcloud, 9 | * and DailyMotion. 10 | */ 11 | 12 | export default class DashPlayer extends Component { 13 | render() { 14 | return ( 15 | 16 | 17 | 18 | ); 19 | } 20 | } 21 | 22 | DashPlayer.defaultProps = { 23 | playing: false, 24 | loop: false, 25 | controls: false, 26 | volume: null, 27 | muted: false, 28 | playbackRate: 1, 29 | width: '640px', 30 | height: '360px', 31 | style:{}, 32 | playsinline: false, 33 | seekTo: null, 34 | intervalCurrentTime: 100, 35 | intervalSecondsLoaded: 500, 36 | intervalDuration: 500 37 | }; 38 | 39 | DashPlayer.propTypes = { 40 | /** 41 | * The ID used to identify this component in Dash callbacks. 42 | */ 43 | id: PropTypes.string, 44 | 45 | /** 46 | * Used to identify the CSS class of the Dash Player component 47 | */ 48 | className: PropTypes.string, 49 | 50 | /** 51 | * Dash-assigned callback that should be called whenever any of the 52 | * properties change 53 | */ 54 | setProps: PropTypes.func, 55 | 56 | /** 57 | * The url of the media to be played. 58 | */ 59 | url: PropTypes.string, 60 | 61 | /** 62 | * Whether or not the media is currently playing. Can be set to True 63 | * or False to play and pause the media, respectively. 64 | */ 65 | playing: PropTypes.bool, 66 | 67 | /** 68 | * Whether or not the media will loop once the player reaches the end. 69 | * Can be set to True or False to set looping on or off, respectively. 70 | */ 71 | loop: PropTypes.bool, 72 | 73 | /** 74 | * Set to true or false to display native player controls 75 | * Vimeo, Twitch and Wistia player will always display controls 76 | */ 77 | controls: PropTypes.bool, 78 | 79 | /** 80 | * A number between 0 and 1 representing the volume of the player. 81 | * If set to None, Dash Player ises default volume on all players. 82 | */ 83 | volume: PropTypes.number, 84 | 85 | /** 86 | * Set to true or false to mute or unmute player volume, respectively. 87 | * Only works if volume is set. 88 | */ 89 | muted: PropTypes.bool, 90 | 91 | /** 92 | * Set the playback rate of the player 93 | * Only supported by YouTube, Wistia, and file paths. 94 | */ 95 | playbackRate: PropTypes.number, 96 | 97 | /** 98 | * A number or string representing the pixel width of the player. 99 | */ 100 | width: PropTypes.string, 101 | 102 | /** 103 | * A number or string representing the pixel height of the player. 104 | */ 105 | height: PropTypes.string, 106 | 107 | /** 108 | * Optional additional CSS styles. If width or height are supplied within style, 109 | * then this will override the component-level width or height 110 | */ 111 | style: PropTypes.object, 112 | 113 | /** 114 | * Applies the html5 playsinline attribute where supported, which allows 115 | * videos to be played inline and will not automatically enter fullscreen 116 | * mode when playback begins (for iOS). 117 | */ 118 | playsinline: PropTypes.bool, 119 | 120 | // Below are instance Methods that are updated at a fixed intervals, and 121 | // used as a properties in dash callbacks. 122 | /** 123 | * Returns the number of seconds that have been played. 124 | */ 125 | currentTime: PropTypes.number, 126 | 127 | /** 128 | * Returns the number of seconds that have been loaded. 129 | */ 130 | secondsLoaded: PropTypes.number, 131 | 132 | /** 133 | * Returns the duration (in seconds) of the currently playing media. 134 | */ 135 | duration: PropTypes.number, 136 | 137 | /** 138 | * Interval in milliseconds at which currentTime prop is updated. 139 | */ 140 | intervalCurrentTime: PropTypes.number, 141 | 142 | /** 143 | * Interval in milliseconds at which secondsLoaded prop is updated. 144 | */ 145 | intervalSecondsLoaded: PropTypes.number, 146 | 147 | /** 148 | * Interval in milliseconds at which duration prop is updated. 149 | */ 150 | intervalDuration: PropTypes.number, 151 | 152 | /** 153 | * Seek to the given number of seconds, or fraction if amount is between 0 and 1 154 | */ 155 | seekTo: PropTypes.number 156 | }; 157 | 158 | export const propTypes = DashPlayer.propTypes; 159 | export const defaultProps = DashPlayer.defaultProps; -------------------------------------------------------------------------------- /src/lib/fragments/DashPlayer.react.js: -------------------------------------------------------------------------------- 1 | import React, {Component} from 'react'; 2 | import ReactPlayer from 'react-player'; 3 | import {propTypes, defaultProps} from '../components/DashPlayer.react'; 4 | 5 | export default class DashPlayer extends Component { 6 | constructor(props) { 7 | super(props); 8 | 9 | this.updateCurrentTime = this.updateCurrentTime.bind(this); 10 | this.updateSecondsLoaded = this.updateSecondsLoaded.bind(this); 11 | this.updateDuration = this.updateDuration.bind(this); 12 | this.updateIntervals = this.updateIntervals.bind(this); 13 | this.setSeekTo = this.setSeekTo.bind(this); 14 | } 15 | 16 | updateCurrentTime(){ 17 | const {setProps} = this.props; 18 | if (this.refs.player !== null){ 19 | const currentTime = this.refs.player.getCurrentTime(); 20 | 21 | if (typeof setProps === 'function') { 22 | setProps({currentTime: currentTime}); 23 | } 24 | } 25 | } 26 | 27 | updateSecondsLoaded(){ 28 | const {setProps} = this.props; 29 | if (this.refs.player !== null){ 30 | const secondsLoaded = this.refs.player.getSecondsLoaded(); 31 | 32 | if (typeof setProps === 'function') { 33 | setProps({secondsLoaded: secondsLoaded}); 34 | } 35 | } 36 | } 37 | 38 | updateDuration(){ 39 | const {setProps} = this.props; 40 | if (this.refs.player !== null){ 41 | const duration = this.refs.player.getDuration(); 42 | 43 | if (typeof setProps === 'function'){ 44 | setProps({duration: duration}); 45 | } 46 | } 47 | } 48 | 49 | /** 50 | * When one of the interval props are changed, this clears the currently 51 | * assigned handle and set it to the new interval value. It works for 52 | * currentTime, duration and secondsLoaded. 53 | */ 54 | updateIntervals(prevProps){ 55 | const { 56 | intervalCurrentTime, 57 | intervalDuration, 58 | intervalSecondsLoaded 59 | } = this.props; 60 | 61 | // Update interval of current time 62 | if (typeof this.handleCurrentTime === 'undefined' || 63 | prevProps.intervalCurrentTime !== intervalCurrentTime){ 64 | clearInterval(this.handleCurrentTime); 65 | this.handleCurrentTime = setInterval( 66 | this.updateCurrentTime, 67 | intervalCurrentTime 68 | ); 69 | } 70 | if (typeof this.handleDuration === 'undefined' || 71 | prevProps.intervalDuration !== intervalDuration){ 72 | clearInterval(this.handleDuration); 73 | this.handleDuration = setInterval( 74 | this.updateDuration, 75 | intervalDuration 76 | ); 77 | } 78 | if (typeof this.handleSecondsLoaded === 'undefined' || 79 | prevProps.intervalSecondsLoaded !== intervalSecondsLoaded){ 80 | clearInterval(this.handleSecondsLoaded); 81 | this.handleSecondsLoaded = setInterval( 82 | this.updateSecondsLoaded, 83 | intervalSecondsLoaded 84 | ); 85 | } 86 | } 87 | 88 | /** 89 | * Applies the seekTo() method to the player if the seekTo prop 90 | * contains any value, then set seekTo to null. If seekTo was already 91 | * null, it doesn't do anything. 92 | */ 93 | setSeekTo(){ 94 | const { 95 | seekTo, 96 | setProps 97 | } = this.props; 98 | 99 | if (seekTo !== null && typeof setProps === 'function'){ 100 | this.refs.player.seekTo(seekTo); 101 | setProps({seekTo: null}); 102 | } 103 | } 104 | 105 | componentDidUpdate(prevProps){ 106 | this.updateIntervals(prevProps); 107 | this.setSeekTo(); 108 | } 109 | 110 | componentDidMount() { 111 | this.updateDuration() 112 | } 113 | 114 | render() { 115 | const { 116 | id, 117 | url, 118 | playing, 119 | loop, 120 | controls, 121 | volume, 122 | muted, 123 | playbackRate, 124 | width, 125 | height, 126 | style, 127 | playsinline, 128 | className 129 | } = this.props; 130 | 131 | return ( 132 | 148 | ); 149 | } 150 | } 151 | 152 | DashPlayer.defaultProps = defaultProps; 153 | DashPlayer.propTypes = propTypes; -------------------------------------------------------------------------------- /src/lib/index.js: -------------------------------------------------------------------------------- 1 | /* eslint-disable import/prefer-default-export */ 2 | import DashPlayer from './components/DashPlayer.react'; 3 | 4 | export { 5 | DashPlayer 6 | }; 7 | -------------------------------------------------------------------------------- /tests/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/plotly/dash-player/bdbe05d9473632e6ef899706d57c20c55a681d4f/tests/__init__.py -------------------------------------------------------------------------------- /tests/test_integration.py: -------------------------------------------------------------------------------- 1 | import dash 2 | from dash import html, Input, Output, State 3 | from dash_player import DashPlayer 4 | 5 | 6 | def test_001_dash_player_exists_with_size(dash_duo): 7 | app = dash.Dash(__name__) 8 | app.layout = html.Div( 9 | children=[ 10 | DashPlayer( 11 | id="video-player", 12 | url="https://media.w3.org/2010/05/bunny/movie.ogv", 13 | playing=True, 14 | controls=True, 15 | width="640px", 16 | height="360px", 17 | ) 18 | ] 19 | ) 20 | dash_duo.start_server(app) 21 | assert ( 22 | dash_duo.find_element("#video-player").get_attribute("style") 23 | == "width: 640px; height: 360px;" 24 | ) 25 | assert ( 26 | dash_duo.find_element("#video-player > video").get_attribute("src") 27 | == "https://media.w3.org/2010/05/bunny/movie.ogv" 28 | ) 29 | assert dash_duo.get_logs() == [], "browser console should contain no error" 30 | 31 | 32 | def test_002_styling(dash_duo): 33 | app = dash.Dash(__name__) 34 | app.layout = html.Div( 35 | children=[ 36 | DashPlayer( 37 | id="video-player", 38 | url="https://media.w3.org/2010/05/bunny/movie.ogv", 39 | playing=True, 40 | controls=True, 41 | style={"border": "5px solid red", "border-radius": "10px"}, 42 | ) 43 | ] 44 | ) 45 | dash_duo.start_server(app) 46 | assert ( 47 | dash_duo.find_element("#video-player").get_attribute("style") 48 | == "border: 5px solid red; border-radius: 10px; width: 640px; height: 360px;" 49 | ) 50 | assert dash_duo.get_logs() == [], "browser console should contain no error" 51 | 52 | 53 | def test_003_toggle_properties_via_callback(dash_duo): 54 | app = dash.Dash(__name__) 55 | app.layout = html.Div( 56 | children=[ 57 | DashPlayer( 58 | id="video-player", 59 | url="https://media.w3.org/2010/05/bunny/movie.ogv", 60 | ), 61 | html.Button(id="playing-btn"), 62 | html.Div(id="playing-div"), 63 | html.Button(id="loop-btn"), 64 | html.Div(id="loop-div"), 65 | html.Button(id="controls-btn"), 66 | html.Div(id="controls-div"), 67 | html.Button(id="muted-btn"), 68 | html.Div(id="muted-div"), 69 | ] 70 | ) 71 | 72 | @app.callback( 73 | Output("video-player", "playing"), 74 | Input("playing-btn", "n_clicks"), 75 | State("video-player", "playing"), 76 | prevent_initial_call=True, 77 | ) 78 | def update_playing(n_clicks, playing): 79 | return not playing 80 | 81 | @app.callback( 82 | Output("video-player", "loop"), 83 | Input("loop-btn", "n_clicks"), 84 | State("video-player", "loop"), 85 | prevent_initial_call=True, 86 | ) 87 | def update_loop(n_clicks, loop): 88 | return not loop 89 | 90 | @app.callback( 91 | Output("video-player", "controls"), 92 | Input("controls-btn", "n_clicks"), 93 | State("video-player", "controls"), 94 | prevent_initial_call=True, 95 | ) 96 | def update_controls(n_clicks, controls): 97 | return not controls 98 | 99 | @app.callback( 100 | Output("video-player", "muted"), 101 | Input("muted-btn", "n_clicks"), 102 | State("video-player", "muted"), 103 | prevent_initial_call=True, 104 | ) 105 | def update_muted(n_clicks, muted): 106 | return not muted 107 | 108 | @app.callback( 109 | Output("playing-div", "children"), 110 | Output("loop-div", "children"), 111 | Output("controls-div", "children"), 112 | Output("muted-div", "children"), 113 | Input("video-player", "playing"), 114 | Input("video-player", "loop"), 115 | Input("video-player", "controls"), 116 | Input("video-player", "muted"), 117 | ) 118 | def output_properties(playing, loop, controls, muted): 119 | return f"{playing}", f"{loop}", f"{controls}", f"{muted}" 120 | 121 | dash_duo.start_server(app) 122 | 123 | playing_btn = dash_duo.find_element("#playing-btn") 124 | loop_btn = dash_duo.find_element("#loop-btn") 125 | controls_btn = dash_duo.find_element("#controls-btn") 126 | muted_btn = dash_duo.find_element("#muted-btn") 127 | 128 | dash_duo.wait_for_text_to_equal("#playing-div", "None") 129 | playing_btn.click() 130 | dash_duo.wait_for_text_to_equal("#playing-div", "True") 131 | 132 | dash_duo.wait_for_text_to_equal("#loop-div", "None") 133 | loop_btn.click() 134 | dash_duo.wait_for_text_to_equal("#loop-div", "True") 135 | 136 | dash_duo.wait_for_text_to_equal("#controls-div", "None") 137 | controls_btn.click() 138 | dash_duo.wait_for_text_to_equal("#controls-div", "True") 139 | 140 | dash_duo.wait_for_text_to_equal("#muted-div", "None") 141 | muted_btn.click() 142 | dash_duo.wait_for_text_to_equal("#muted-div", "True") 143 | -------------------------------------------------------------------------------- /webpack.config.js: -------------------------------------------------------------------------------- 1 | const path = require('path'); 2 | const packagejson = require('./package.json'); 3 | 4 | const dashLibraryName = packagejson.name.replace('@plotly/','').replace(/-/g, '_'); 5 | 6 | const WebpackDashDynamicImport = require('@plotly/webpack-dash-dynamic-import'); 7 | 8 | module.exports = (env, argv) => { 9 | 10 | let mode; 11 | 12 | const overrides = module.exports || {}; 13 | 14 | // if user specified mode flag take that value 15 | if (argv && argv.mode) { 16 | mode = argv.mode; 17 | } 18 | 19 | // else if configuration object is already set (module.exports) use that value 20 | else if (overrides.mode) { 21 | mode = overrides.mode; 22 | } 23 | 24 | // else take webpack default (production) 25 | else { 26 | mode = 'production'; 27 | } 28 | 29 | let filename = (overrides.output || {}).filename; 30 | if(!filename) { 31 | const modeSuffix = mode === 'development' ? 'dev' : 'min'; 32 | filename = `${dashLibraryName}.${modeSuffix}.js`; 33 | } 34 | 35 | const entry = overrides.entry || {main: './src/lib/index.js'}; 36 | 37 | const devtool = overrides.devtool || 'source-map'; 38 | 39 | const externals = ('externals' in overrides) ? overrides.externals : ({ 40 | react: 'React', 41 | 'react-dom': 'ReactDOM', 42 | 'plotly.js': 'Plotly', 43 | }); 44 | 45 | return { 46 | mode, 47 | entry, 48 | output: { 49 | path: path.resolve(__dirname, dashLibraryName), 50 | chunkFilename: '[name].js', 51 | filename, 52 | library: dashLibraryName, 53 | libraryTarget: 'window', 54 | }, 55 | externals, 56 | module: { 57 | rules: [ 58 | { 59 | test: /\.js$/, 60 | exclude: /node_modules/, 61 | use: { 62 | loader: 'babel-loader', 63 | }, 64 | }, 65 | { 66 | test: /\.css$/, 67 | use: [ 68 | { 69 | loader: 'style-loader', 70 | }, 71 | { 72 | loader: 'css-loader', 73 | }, 74 | ], 75 | }, 76 | ], 77 | }, 78 | devtool, 79 | optimization: { 80 | splitChunks: { 81 | name: '[name].js', 82 | cacheGroups: { 83 | async: { 84 | chunks: 'async', 85 | minSize: 0, 86 | name(module, chunks, cacheGroupKey) { 87 | return `${cacheGroupKey}-${chunks[0].name}`; 88 | } 89 | } 90 | } 91 | } 92 | }, 93 | plugins: [ 94 | new WebpackDashDynamicImport() 95 | ] 96 | } 97 | }; 98 | -------------------------------------------------------------------------------- /webpack.serve.config.js: -------------------------------------------------------------------------------- 1 | const config = require('./webpack.config.js'); 2 | 3 | config.entry = {main: './src/demo/index.js'}; 4 | config.output = {filename: 'output.js'}; 5 | config.mode = 'development'; 6 | config.externals = undefined; // eslint-disable-line 7 | config.devtool = 'inline-source-map'; 8 | module.exports = config; 9 | --------------------------------------------------------------------------------