Pyckplayer 1.0.2__tar.gz → 1.0.3__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {pyckplayer-1.0.2/src/Pyckplayer.egg-info → pyckplayer-1.0.3}/PKG-INFO +1 -1
- {pyckplayer-1.0.2 → pyckplayer-1.0.3}/setup.py +1 -1
- {pyckplayer-1.0.2 → pyckplayer-1.0.3/src/Pyckplayer.egg-info}/PKG-INFO +1 -1
- {pyckplayer-1.0.2 → pyckplayer-1.0.3}/src/pyckplayer/core.py +33 -3
- {pyckplayer-1.0.2 → pyckplayer-1.0.3}/LICENSE +0 -0
- {pyckplayer-1.0.2 → pyckplayer-1.0.3}/MANIFEST.in +0 -0
- {pyckplayer-1.0.2 → pyckplayer-1.0.3}/README.md +0 -0
- {pyckplayer-1.0.2 → pyckplayer-1.0.3}/pyproject.toml +0 -0
- {pyckplayer-1.0.2 → pyckplayer-1.0.3}/setup.cfg +0 -0
- {pyckplayer-1.0.2 → pyckplayer-1.0.3}/src/Pyckplayer.egg-info/SOURCES.txt +0 -0
- {pyckplayer-1.0.2 → pyckplayer-1.0.3}/src/Pyckplayer.egg-info/dependency_links.txt +0 -0
- {pyckplayer-1.0.2 → pyckplayer-1.0.3}/src/Pyckplayer.egg-info/entry_points.txt +0 -0
- {pyckplayer-1.0.2 → pyckplayer-1.0.3}/src/Pyckplayer.egg-info/requires.txt +0 -0
- {pyckplayer-1.0.2 → pyckplayer-1.0.3}/src/Pyckplayer.egg-info/top_level.txt +0 -0
- {pyckplayer-1.0.2 → pyckplayer-1.0.3}/src/pyckplayer/__init__.py +0 -0
- {pyckplayer-1.0.2 → pyckplayer-1.0.3}/src/pyckplayer/ckplayer/LICENSE +0 -0
- {pyckplayer-1.0.2 → pyckplayer-1.0.3}/src/pyckplayer/ckplayer/css/ckplayer.css +0 -0
- {pyckplayer-1.0.2 → pyckplayer-1.0.3}/src/pyckplayer/ckplayer/css/ckplayer.ixigua.css +0 -0
- {pyckplayer-1.0.2 → pyckplayer-1.0.3}/src/pyckplayer/ckplayer/css/ckplayer.red.css +0 -0
- {pyckplayer-1.0.2 → pyckplayer-1.0.3}/src/pyckplayer/ckplayer/css/images/adclose.png +0 -0
- {pyckplayer-1.0.2 → pyckplayer-1.0.3}/src/pyckplayer/ckplayer/css/images/buffer.png +0 -0
- {pyckplayer-1.0.2 → pyckplayer-1.0.3}/src/pyckplayer/ckplayer/css/images/ckplayer.48.png +0 -0
- {pyckplayer-1.0.2 → pyckplayer-1.0.3}/src/pyckplayer/ckplayer/css/images/ckplayer.png +0 -0
- {pyckplayer-1.0.2 → pyckplayer-1.0.3}/src/pyckplayer/ckplayer/css/images/ckplayer_ixigua.48.png +0 -0
- {pyckplayer-1.0.2 → pyckplayer-1.0.3}/src/pyckplayer/ckplayer/css/images/ckplayer_ixigua.png +0 -0
- {pyckplayer-1.0.2 → pyckplayer-1.0.3}/src/pyckplayer/ckplayer/css/images/ckplayer_red.48.png +0 -0
- {pyckplayer-1.0.2 → pyckplayer-1.0.3}/src/pyckplayer/ckplayer/css/images/ckplayer_red.png +0 -0
- {pyckplayer-1.0.2 → pyckplayer-1.0.3}/src/pyckplayer/ckplayer/css/images/favicon.ico +0 -0
- {pyckplayer-1.0.2 → pyckplayer-1.0.3}/src/pyckplayer/ckplayer/css/images/loading.png +0 -0
- {pyckplayer-1.0.2 → pyckplayer-1.0.3}/src/pyckplayer/ckplayer/css/images/logo.png +0 -0
- {pyckplayer-1.0.2 → pyckplayer-1.0.3}/src/pyckplayer/ckplayer/css/images/play.png +0 -0
- {pyckplayer-1.0.2 → pyckplayer-1.0.3}/src/pyckplayer/ckplayer/flv.js/LICENSE +0 -0
- {pyckplayer-1.0.2 → pyckplayer-1.0.3}/src/pyckplayer/ckplayer/flv.js/README.md +0 -0
- {pyckplayer-1.0.2 → pyckplayer-1.0.3}/src/pyckplayer/ckplayer/flv.js/flv.js +0 -0
- {pyckplayer-1.0.2 → pyckplayer-1.0.3}/src/pyckplayer/ckplayer/flv.js/flv.js.map +0 -0
- {pyckplayer-1.0.2 → pyckplayer-1.0.3}/src/pyckplayer/ckplayer/flv.js/flv.min.js +0 -0
- {pyckplayer-1.0.2 → pyckplayer-1.0.3}/src/pyckplayer/ckplayer/flv.js/flv.min.js.map +0 -0
- {pyckplayer-1.0.2 → pyckplayer-1.0.3}/src/pyckplayer/ckplayer/hls.js/LICENSE +0 -0
- {pyckplayer-1.0.2 → pyckplayer-1.0.3}/src/pyckplayer/ckplayer/hls.js/README.md +0 -0
- {pyckplayer-1.0.2 → pyckplayer-1.0.3}/src/pyckplayer/ckplayer/hls.js/hls-demo.js +0 -0
- {pyckplayer-1.0.2 → pyckplayer-1.0.3}/src/pyckplayer/ckplayer/hls.js/hls-demo.js.map +0 -0
- {pyckplayer-1.0.2 → pyckplayer-1.0.3}/src/pyckplayer/ckplayer/hls.js/hls.js +0 -0
- {pyckplayer-1.0.2 → pyckplayer-1.0.3}/src/pyckplayer/ckplayer/hls.js/hls.js.d.ts +0 -0
- {pyckplayer-1.0.2 → pyckplayer-1.0.3}/src/pyckplayer/ckplayer/hls.js/hls.js.map +0 -0
- {pyckplayer-1.0.2 → pyckplayer-1.0.3}/src/pyckplayer/ckplayer/hls.js/hls.light.js +0 -0
- {pyckplayer-1.0.2 → pyckplayer-1.0.3}/src/pyckplayer/ckplayer/hls.js/hls.light.js.map +0 -0
- {pyckplayer-1.0.2 → pyckplayer-1.0.3}/src/pyckplayer/ckplayer/hls.js/hls.light.min.js +0 -0
- {pyckplayer-1.0.2 → pyckplayer-1.0.3}/src/pyckplayer/ckplayer/hls.js/hls.light.min.js.map +0 -0
- {pyckplayer-1.0.2 → pyckplayer-1.0.3}/src/pyckplayer/ckplayer/hls.js/hls.min.js +0 -0
- {pyckplayer-1.0.2 → pyckplayer-1.0.3}/src/pyckplayer/ckplayer/hls.js/hls.min.js.map +0 -0
- {pyckplayer-1.0.2 → pyckplayer-1.0.3}/src/pyckplayer/ckplayer/js/ckplayer.js +0 -0
- {pyckplayer-1.0.2 → pyckplayer-1.0.3}/src/pyckplayer/ckplayer/js/ckplayer.min.js +0 -0
- {pyckplayer-1.0.2 → pyckplayer-1.0.3}/src/pyckplayer/ckplayer/language/en.js +0 -0
- {pyckplayer-1.0.2 → pyckplayer-1.0.3}/src/pyckplayer/ckplayer/language/zh.cn.js +0 -0
- {pyckplayer-1.0.2 → pyckplayer-1.0.3}/src/pyckplayer/ckplayer/language/zh.hk.js +0 -0
- {pyckplayer-1.0.2 → pyckplayer-1.0.3}/src/pyckplayer/ckplayer/mpegts.js/LICENSE +0 -0
- {pyckplayer-1.0.2 → pyckplayer-1.0.3}/src/pyckplayer/ckplayer/mpegts.js/mpegts.js +0 -0
- {pyckplayer-1.0.2 → pyckplayer-1.0.3}/src/pyckplayer/ckplayer/mpegts.js/mpegts.js.map +0 -0
- {pyckplayer-1.0.2 → pyckplayer-1.0.3}/src/pyckplayer/ckplayer/mpegts.js/mpegts.min.js +0 -0
- {pyckplayer-1.0.2 → pyckplayer-1.0.3}/src/pyckplayer/cli.py +0 -0
|
@@ -91,6 +91,18 @@ def download_cover(poster_url: Optional[str], silent: bool = True) -> Optional[s
|
|
|
91
91
|
return None
|
|
92
92
|
|
|
93
93
|
|
|
94
|
+
def detect_stream_type(url: str) -> str:
|
|
95
|
+
url_lower = url.lower()
|
|
96
|
+
if '.m3u8' in url_lower or '/hls/' in url_lower:
|
|
97
|
+
return 'hls'
|
|
98
|
+
elif '.flv' in url_lower:
|
|
99
|
+
return 'flv'
|
|
100
|
+
elif '.mp4' in url_lower:
|
|
101
|
+
return 'mp4'
|
|
102
|
+
else:
|
|
103
|
+
return 'auto'
|
|
104
|
+
|
|
105
|
+
|
|
94
106
|
def generate_html(video_url: str,
|
|
95
107
|
poster_url: Optional[str] = None,
|
|
96
108
|
title: str = "CKPlayer") -> str:
|
|
@@ -98,15 +110,31 @@ def generate_html(video_url: str,
|
|
|
98
110
|
css_path = quote((script_dir / "ckplayer" / "css" / "ckplayer.css").as_posix())
|
|
99
111
|
js_path = quote((script_dir / "ckplayer" / "js" / "ckplayer.js").as_posix())
|
|
100
112
|
favicon_path = quote((script_dir / "ckplayer" / "css" / "images" / "logo.png").as_posix())
|
|
113
|
+
|
|
114
|
+
hls_js_path = quote((script_dir / "ckplayer" / "hls.js" / "hls.min.js").as_posix())
|
|
115
|
+
flv_js_path = quote((script_dir / "ckplayer" / "flv.js" / "flv.min.js").as_posix())
|
|
101
116
|
|
|
117
|
+
stream_type = detect_stream_type(video_url)
|
|
118
|
+
|
|
102
119
|
video_object = {
|
|
103
120
|
"container": "#player",
|
|
104
121
|
"variable": "player",
|
|
105
122
|
"video": video_url,
|
|
106
|
-
"autoplay":
|
|
107
|
-
"loop":
|
|
123
|
+
"autoplay": True,
|
|
124
|
+
"loop": False,
|
|
125
|
+
"live": stream_type in ['hls', 'flv'],
|
|
126
|
+
"buffer": 1,
|
|
127
|
+
"preload": "auto",
|
|
128
|
+
"playbackRate": [0.5, 0.75, 1, 1.25, 1.5, 2],
|
|
108
129
|
}
|
|
109
130
|
|
|
131
|
+
if stream_type == 'hls':
|
|
132
|
+
video_object["hls"] = True
|
|
133
|
+
video_object["engine"] = "html5"
|
|
134
|
+
elif stream_type == 'flv':
|
|
135
|
+
video_object["flv"] = True
|
|
136
|
+
video_object["engine"] = "html5"
|
|
137
|
+
|
|
110
138
|
if poster_url:
|
|
111
139
|
video_object["poster"] = poster_url
|
|
112
140
|
|
|
@@ -121,6 +149,8 @@ def generate_html(video_url: str,
|
|
|
121
149
|
<link rel="icon" href="file:///{favicon_path}" type="image/png">
|
|
122
150
|
<link rel="shortcut icon" href="file:///{favicon_path}" type="image/png">
|
|
123
151
|
<link rel="stylesheet" href="file:///{css_path}">
|
|
152
|
+
<script src="file:///{hls_js_path}"></script>
|
|
153
|
+
<script src="file:///{flv_js_path}"></script>
|
|
124
154
|
<script src="file:///{js_path}"></script>
|
|
125
155
|
<style>
|
|
126
156
|
body, html {{ margin: 0; padding: 0; background-color: #000; overflow: hidden; }}
|
|
@@ -131,7 +161,7 @@ def generate_html(video_url: str,
|
|
|
131
161
|
<div id="player"></div>
|
|
132
162
|
<script>
|
|
133
163
|
var videoObject = {video_object_js};
|
|
134
|
-
new ckplayer(videoObject);
|
|
164
|
+
var player = new ckplayer(videoObject);
|
|
135
165
|
</script>
|
|
136
166
|
</body>
|
|
137
167
|
</html>"""
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{pyckplayer-1.0.2 → pyckplayer-1.0.3}/src/pyckplayer/ckplayer/css/images/ckplayer_ixigua.48.png
RENAMED
|
File without changes
|
{pyckplayer-1.0.2 → pyckplayer-1.0.3}/src/pyckplayer/ckplayer/css/images/ckplayer_ixigua.png
RENAMED
|
File without changes
|
{pyckplayer-1.0.2 → pyckplayer-1.0.3}/src/pyckplayer/ckplayer/css/images/ckplayer_red.48.png
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|