feat: Add support for custom file names in screenshot functionality

This commit is contained in:
Harvey Zack committed 2024-07-04 09:57:13 +08:00
1 parent caddb2091e
commit e71e6ad0dd
3 files changed
+6 -5

No files matched your search

@@ -344,7 +344,7 @@ art.on('ready', () => {
- Type: `Function`
下载当前视频帧的截图
下载当前视频帧的截图, 可选参数为截图名字
<div className="run-code">▶ Run Code</div>
@@ -355,7 +355,7 @@ var art = new Artplayer({
});
art.on('ready', () => {
art.screenshot();
art.screenshot('your-name');
});
```
@@ -338,7 +338,7 @@ Some videos do not have a duration, such as videos that are being live streamed
- Type: `Function`
Download a screenshot of the current video frame
Download a screenshot of the current video frame, optional parameter is the screenshot name
<div className="run-code">▶ Run Code</div>
@@ -349,9 +349,10 @@ var art = new Artplayer({
});
art.on('ready', () => {
art.screenshot();
art.screenshot('your-name');
});
```
## `getDataURL`
- Type: `Function`
+1 -1
View File
@@ -72,7 +72,7 @@ export declare class Player {
switchQuality(url: string): Promise<void>;
getDataURL(): Promise<string>;
getBlobUrl(): Promise<string>;
screenshot(): Promise<string>;
screenshot(name?: string): Promise<string>;
airplay(): void;
autoSize(): void;
autoHeight(): void;