Run npm build:all

This commit is contained in:
Alex Hsu
2022-09-16 23:20:48 -04:00
parent 57a1439be5
commit fea4a06099
7 changed files with 134 additions and 206 deletions
+71 -33
View File
@@ -10,46 +10,84 @@ YouTube, Facebook, Twitch, SoundCloud, Streamable, Vimeo, Wistia, Mixcloud,
and DailyMotion.
Keyword arguments:
- id (string; optional): The ID used to identify this compnent in Dash callbacks
- url (string; optional): The url of a video or song to play
◦ Can be an array or MediaStream object
- playing (boolean; optional): Set to true or false to pause or play the media
- loop (boolean; optional): Set to true or false to loop the media
- controls (boolean; optional): Set to true or false to display native player controls
Vimeo, Twitch and Wistia player will always display controls
- volume (number; optional): Set the volume of the player, between 0 and 1
null uses default volume on all players
- muted (boolean; optional): Mutes the player
Only works if volume is set
- playbackRate (number; optional): Set the playback rate of the player
Only supported by YouTube, Wistia, and file paths
- width (string; optional): Set the width of the player
- height (string; optional): Set the height of the player
- style (dict; optional): Add inline styles to the root element
- playsinline (boolean; optional): 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).
- currentTime (number; optional): Returns the number of seconds that have been played
- secondsLoaded (number; optional): Returns the number of seconds that have been loaded
- duration (number; optional): Returns the duration (in seconds) of the currently playing media
- intervalCurrentTime (number; optional): Interval in milliseconds at which currenTtime prop is updated.
- intervalSecondsLoaded (number; optional): Interval in milliseconds at which secondsLoaded prop is updated.
- intervalDuration (number; optional): Interval in milliseconds at which duration prop is updated.
- seekTo (number; optional): Seek to the given number of seconds, or fraction if amount is between 0 and 1"""
- id (string; optional):
The ID used to identify this compnent in Dash callbacks.
- controls (boolean; default False):
Set to True or False to display native player controls Vimeo,
Twitch and Wistia player will always display controls.
- currentTime (number; optional):
Returns the number of seconds that have been played.
- duration (number; optional):
Returns the duration (in seconds) of the currently playing media.
- height (string; default '360px'):
Set the height of the player.
- intervalCurrentTime (number; default 100):
Interval in milliseconds at which currenTtime prop is updated.
- intervalDuration (number; default 500):
Interval in milliseconds at which duration prop is updated.
- intervalSecondsLoaded (number; default 500):
Interval in milliseconds at which secondsLoaded prop is updated.
- loop (boolean; default False):
Set to True or False to loop the media.
- muted (boolean; default False):
Mutes the player Only works if volume is set.
- playbackRate (number; default 1):
Set the playback rate of the player Only supported by YouTube,
Wistia, and file paths.
- playing (boolean; default False):
Set to True or False to pause or play the media.
- playsinline (boolean; default False):
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).
- secondsLoaded (number; optional):
Returns the number of seconds that have been loaded.
- seekTo (number; optional):
Seek to the given number of seconds, or fraction if amount is
between 0 and 1.
- style (dict; optional):
Add inline styles to the root element.
- url (string; optional):
The url of a video or song to play ◦ Can be an array or
MediaStream object.
- volume (number; optional):
Set the volume of the player, between 0 and 1 None uses default
volume on all players.
- width (string; default '640px'):
Set the width of the player."""
_children_props = []
_base_nodes = ['children']
_namespace = 'dash_player'
_type = 'DashPlayer'
@_explicitize_args
def __init__(self, id=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):
self._prop_names = ['id', 'url', 'playing', 'loop', 'controls', 'volume', 'muted', 'playbackRate', 'width', 'height', 'style', 'playsinline', 'currentTime', 'secondsLoaded', 'duration', 'intervalCurrentTime', 'intervalSecondsLoaded', 'intervalDuration', 'seekTo']
self._type = 'DashPlayer'
self._namespace = 'dash_player'
self._prop_names = ['id', 'controls', 'currentTime', 'duration', 'height', 'intervalCurrentTime', 'intervalDuration', 'intervalSecondsLoaded', 'loop', 'muted', 'playbackRate', 'playing', 'playsinline', 'secondsLoaded', 'seekTo', 'style', 'url', 'volume', 'width']
self._valid_wildcard_attributes = []
self.available_properties = ['id', 'url', 'playing', 'loop', 'controls', 'volume', 'muted', 'playbackRate', 'width', 'height', 'style', 'playsinline', 'currentTime', 'secondsLoaded', 'duration', 'intervalCurrentTime', 'intervalSecondsLoaded', 'intervalDuration', 'seekTo']
self.available_properties = ['id', 'controls', 'currentTime', 'duration', 'height', 'intervalCurrentTime', 'intervalDuration', 'intervalSecondsLoaded', 'loop', 'muted', 'playbackRate', 'playing', 'playsinline', 'secondsLoaded', 'seekTo', 'style', 'url', 'volume', 'width']
self.available_wildcard_properties = []
_explicit_args = kwargs.pop('_explicit_args')
_locals = locals()
_locals.update(kwargs) # For wildcard attrs
_locals.update(kwargs) # For wildcard attrs and excess named props
args = {k: _locals[k] for k in _explicit_args if k != 'children'}
for k in []:
if k not in args:
raise TypeError(
+13 -17
View File
@@ -10,37 +10,33 @@ import dash as _dash
from ._imports_ import *
from ._imports_ import __all__
if not hasattr(_dash, 'development'):
print('Dash was not successfully imported. '
'Make sure you don\'t have a file '
'named \n"dash.py" in your current directory.', file=_sys.stderr)
if not hasattr(_dash, "development"):
print(
"Dash was not successfully imported. "
"Make sure you don't have a file "
'named \n"dash.py" in your current directory.',
file=_sys.stderr,
)
_sys.exit(1)
_basepath = _os.path.dirname(__file__)
_filepath = _os.path.abspath(_os.path.join(_basepath, 'package.json'))
_filepath = _os.path.abspath(_os.path.join(_basepath, "package.json"))
with open(_filepath) as f:
package = json.load(f)
package_name = package['name'].replace(' ', '_').replace('-', '_')
__version__ = package['version']
package_name = package["name"].replace(" ", "_").replace("-", "_")
__version__ = package["version"]
_current_path = _os.path.dirname(_os.path.abspath(__file__))
_this_module = _sys.modules[__name__]
_js_dist = [
{
'relative_package_path': 'dash_player.min.js',
'dev_package_path': 'dash_player.dev.js',
'namespace': package_name
}
]
_js_dist = [{"relative_package_path": "dash_player.min.js", "namespace": package_name}]
_css_dist = []
for _component in __all__:
setattr(locals()[_component], '_js_dist', _js_dist)
setattr(locals()[_component], '_css_dist', _css_dist)
setattr(locals()[_component], "_js_dist", _js_dist)
setattr(locals()[_component], "_css_dist", _css_dist)
+2 -1
View File
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
+47 -32
View File
@@ -2,48 +2,63 @@
"name": "dash_player",
"version": "0.0.1",
"description": "Dash player component for videos",
"main": "build/index.js",
"repository": {
"type": "git",
"url": "git://github.com/plotly/dash-player.git"
},
"homepage": "https://github.com/plotly/dash-player",
"bugs": {
"url": "https://github.com/plotly/dash-player/issues"
},
"main": "dash_player/dash_player.min.js",
"author": "Xing Han Lu <xinghan@plot.ly>",
"maintainer": "Alex Hsu <alex.hsu@plot.ly>",
"license": "MIT",
"dependencies": {
"react-player": "2.11.0",
"ramda": "^0.28.0"
},
"scripts": {
"start": "webpack-serve ./webpack.serve.config.js --open",
"validate-init": "python _validate_init.py",
"prepublish": "npm run validate-init",
"build:js-dev": "webpack --mode development",
"build:js": "webpack --mode production",
"build:js-dev": "webpack",
"build:js": "webpack",
"build:py": "dash-generate-components ./src/lib/components dash_player",
"build:py-activated": "(. venv/bin/activate || venv\\scripts\\activate && npm run build:py)",
"build:all": "npm run build:js && npm run build:js-dev && npm run build:py",
"build:all-activated": "(. venv/bin/activate || venv\\scripts\\activate && npm run build:all)"
},
"author": "kris ycaokris@plot.ly",
"license": "MIT",
"dependencies": {
"react-player": "1.6.4",
"ramda": "^0.25.0",
"react": "15.4.2"
},
"devDependencies": {
"babel-core": "^6.26.3",
"babel-eslint": "^8.2.3",
"babel-loader": "^7.1.4",
"copyfiles": "^2.0.0",
"babel-preset-env": "^1.7.0",
"babel-preset-react": "^6.24.1",
"css-loader": "^0.28.11",
"eslint": "^4.19.1",
"eslint-config-prettier": "^2.9.0",
"eslint-plugin-import": "^2.12.0",
"eslint-plugin-react": "^7.9.1",
"npm": "^6.1.0",
"react-docgen": "^2.20.1",
"style-loader": "^0.21.0",
"webpack": "^4.20.2",
"webpack-cli": "^3.1.1",
"webpack-serve": "^1.0.2",
"react": ">=0.14",
"react-dom": ">=0.14"
"@types/node": "^18.7.18",
"@babel/core": "^7.5.4",
"@babel/plugin-proposal-object-rest-spread": "^7.5.4",
"@babel/preset-env": "^7.5.4",
"@babel/preset-react": "^7.0.0",
"babel-eslint": "^10.0.2",
"babel-loader": "^8.0.6",
"copyfiles": "^2.4.1",
"css-loader": "^6.7.1",
"eslint": "^8.23.1",
"eslint-config-prettier": "^8.5.0",
"eslint-plugin-import": "^2.26.0",
"eslint-plugin-react": "^7.31.8",
"glob-parent": "6.0.2",
"npm": "^8.19.2",
"react": ">=18.2",
"react-docgen": "^5.4.3",
"react-dom": ">=18.2",
"styled-jsx": "^3.2.1",
"style-loader": "^3.3.1",
"webpack": "^5.74.0",
"webpack-cli": "^4.10.0",
"webpack-serve": "^4.0.0"
},
"peerDependencies": {
"browserslist": ">= 4.21.0",
"webpack": "^4.29.0"
},
"engines": {
"node": ">=8.11.0",
"npm": ">=6.1.0"
"node": ">=14.14.0",
"npm": ">=6.14.8"
}
}
-13
View File
@@ -1,13 +0,0 @@
% Auto-generated: do not edit by hand
\docType{package}
\name{dashPlayer-package}
\alias{dashPlayer}
\title{Interactive Media Player Component for Dash
}
\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.
}
\author{
\strong{Maintainer}: Ryan Patrick Kyle <ryan@plot.ly>
}
-110
View File
@@ -1,110 +0,0 @@
% Auto-generated: do not edit by hand
\name{dashPlayer}
\alias{dashPlayer}
\title{DashPlayer component}
\description{
A Dash component for playing a variety of URLs, including file paths, YouTube, Facebook, Twitch, SoundCloud, Streamable, Vimeo, Wistia, Mixcloud, and DailyMotion.
}
\usage{
dashPlayer(id=NULL, url=NULL, playing=NULL, loop=NULL, controls=NULL, volume=NULL,
muted=NULL, playbackRate=NULL, width=NULL, height=NULL, style=NULL,
playsinline=NULL, currentTime=NULL, secondsLoaded=NULL, duration=NULL,
intervalCurrentTime=NULL, intervalSecondsLoaded=NULL, intervalDuration=NULL,
seekTo=NULL)
}
\arguments{
\item{id}{Character. The ID used to identify this compnent in Dash callbacks}
\item{url}{Character. The url of a video or song to play
◦ Can be an array or MediaStream object}
\item{playing}{Logical. Set to true or false to pause or play the media}
\item{loop}{Logical. Set to true or false to loop the media}
\item{controls}{Logical. Set to true or false to display native player controls
Vimeo, Twitch and Wistia player will always display controls}
\item{volume}{Numeric. Set the volume of the player, between 0 and 1
null uses default volume on all players}
\item{muted}{Logical. Mutes the player
Only works if volume is set}
\item{playbackRate}{Numeric. Set the playback rate of the player
Only supported by YouTube, Wistia, and file paths}
\item{width}{Character. Set the width of the player}
\item{height}{Character. Set the height of the player}
\item{style}{Named list. Add inline styles to the root element}
\item{playsinline}{Logical. 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).}
\item{currentTime}{Numeric. Returns the number of seconds that have been played}
\item{secondsLoaded}{Numeric. Returns the number of seconds that have been loaded}
\item{duration}{Numeric. Returns the duration (in seconds) of the currently playing media}
\item{intervalCurrentTime}{Numeric. Interval in milliseconds at which currenTtime prop is updated.}
\item{intervalSecondsLoaded}{Numeric. Interval in milliseconds at which secondsLoaded prop is updated.}
\item{intervalDuration}{Numeric. Interval in milliseconds at which duration prop is updated.}
\item{seekTo}{Numeric. Seek to the given number of seconds, or fraction if amount is between 0 and 1}
}
\examples{
\dontrun{
library(dash)
library(dashHtmlComponents)
library(dashCoreComponents)
library(dashPlayer)
app <- Dash$new()
app$layout(
htmlDiv(list(
htmlDiv(
children = list(
dashPlayer(
id = 'video-player',
controls = TRUE,
width='100\%'
)
)
),
htmlDiv(list(
dccInput(id = 'input-url',
value = 'http://media.w3.org/2010/05/bunny/movie.mp4'),
htmlButton(children = 'Change URL',
id = 'button-update-url')
)
)
)
)
)
app$callback(output=list(id='video-player', property='url'),
params=list(
input(id='button-update-url', property='n_clicks'),
state(id='input-url', property='value')),
function(n_clicks, value)
{
return(value)
}
)
app$run_server()
}
}