mirror of
https://github.com/zhw2590582/ArtPlayer.git
synced 2026-10-29 02:51:20 -08:00
Update ads docs
This commit is contained in:
1 parent
b584550917
commit
75baca8462
7 files changed
+198
-14
No files matched your search
@@ -27,6 +27,7 @@ export default class Ads {
|
||||
}
|
||||
|
||||
play(item) {
|
||||
if (this.isEnd || !item.url) return;
|
||||
this.art.player.switchUrl(item.url);
|
||||
|
||||
this.art.once('video:timeupdate', () => {
|
||||
@@ -45,6 +46,7 @@ export default class Ads {
|
||||
}
|
||||
|
||||
end() {
|
||||
if (this.isEnd) return;
|
||||
this.isEnd = true;
|
||||
this.playing = false;
|
||||
this.art.option.url = this.urlCache;
|
||||
|
||||
+18
-6
@@ -139,6 +139,13 @@ type SubtitleOption = {
|
||||
bilingual?: boolean;
|
||||
};
|
||||
|
||||
type AdsOption = {
|
||||
/**
|
||||
* The ads video url
|
||||
*/
|
||||
url: string;
|
||||
};
|
||||
|
||||
type Option = {
|
||||
/**
|
||||
* The container mounted by the player
|
||||
@@ -308,12 +315,7 @@ type Option = {
|
||||
/**
|
||||
* Custom ads list
|
||||
*/
|
||||
ads?: {
|
||||
/**
|
||||
* The ads video url
|
||||
*/
|
||||
url: string;
|
||||
}[];
|
||||
ads?: AdsOption[];
|
||||
|
||||
/**
|
||||
* Custom layer list
|
||||
@@ -654,6 +656,16 @@ declare class Artplayer extends Player {
|
||||
switch(url: string, option?: SubtitleOption): Promise<string>;
|
||||
};
|
||||
|
||||
readonly ads: {
|
||||
index: number;
|
||||
isEnd: boolean;
|
||||
playing: boolean;
|
||||
current: AdsOption;
|
||||
prev: AdsOption;
|
||||
next: AdsOption;
|
||||
end(): void;
|
||||
};
|
||||
|
||||
readonly mobile: object;
|
||||
|
||||
readonly player: Player;
|
||||
|
||||
Reference in new issue
Block a user