diff options
author | LoveIsGrief <LoveIsGrief@users.noreply.github.com> | 2019-09-24 08:48:01 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2019-09-24 08:48:01 +0200 |
commit | 6aa541481390980f9c85d2e66514ba0e6ce77a35 (patch) | |
tree | 7b2e934647a732645c69e5d05e4b18152b50a6b8 /client/src/app/+my-account | |
parent | 32d7f2b754b8d20bf44ae2121c79570cbff973c3 (diff) | |
download | PeerTube-6aa541481390980f9c85d2e66514ba0e6ce77a35.tar.gz PeerTube-6aa541481390980f9c85d2e66514ba0e6ce77a35.tar.zst PeerTube-6aa541481390980f9c85d2e66514ba0e6ce77a35.zip |
Autoplay next recommended video (#2137)
* Start working on autoplay of next video
* Ignore changes made by gitpod
* Apply changes from PR#1370
* Correct the spelling of recommendations
* Fix linting errors
* Move boolean check to existing onEnded handler
* Pick a random video until the recommendations are improved
* Add simple tests for autoPlayNextVideo
* Fix lint
...again
Diffstat (limited to 'client/src/app/+my-account')
2 files changed, 9 insertions, 0 deletions
diff --git a/client/src/app/+my-account/my-account-settings/my-account-video-settings/my-account-video-settings.component.html b/client/src/app/+my-account/my-account-settings/my-account-video-settings/my-account-video-settings.component.html index a11238925..06fd9833a 100644 --- a/client/src/app/+my-account/my-account-settings/my-account-video-settings/my-account-video-settings.component.html +++ b/client/src/app/+my-account/my-account-settings/my-account-video-settings/my-account-video-settings.component.html | |||
@@ -47,6 +47,11 @@ | |||
47 | inputName="autoPlayVideo" formControlName="autoPlayVideo" | 47 | inputName="autoPlayVideo" formControlName="autoPlayVideo" |
48 | i18n-labelText labelText="Automatically plays video" | 48 | i18n-labelText labelText="Automatically plays video" |
49 | ></my-peertube-checkbox> | 49 | ></my-peertube-checkbox> |
50 | |||
51 | <my-peertube-checkbox | ||
52 | inputName="autoPlayNextVideo" formControlName="autoPlayNextVideo" | ||
53 | i18n-labelText labelText="Automatically starts playing next video" | ||
54 | ></my-peertube-checkbox> | ||
50 | </div> | 55 | </div> |
51 | 56 | ||
52 | <input type="submit" i18n-value value="Save" [disabled]="!form.valid"> | 57 | <input type="submit" i18n-value value="Save" [disabled]="!form.valid"> |
diff --git a/client/src/app/+my-account/my-account-settings/my-account-video-settings/my-account-video-settings.component.ts b/client/src/app/+my-account/my-account-settings/my-account-video-settings/my-account-video-settings.component.ts index 4fb828082..99eee23b8 100644 --- a/client/src/app/+my-account/my-account-settings/my-account-video-settings/my-account-video-settings.component.ts +++ b/client/src/app/+my-account/my-account-settings/my-account-video-settings/my-account-video-settings.component.ts | |||
@@ -36,6 +36,7 @@ export class MyAccountVideoSettingsComponent extends FormReactive implements OnI | |||
36 | nsfwPolicy: null, | 36 | nsfwPolicy: null, |
37 | webTorrentEnabled: null, | 37 | webTorrentEnabled: null, |
38 | autoPlayVideo: null, | 38 | autoPlayVideo: null, |
39 | autoPlayNextVideo: null, | ||
39 | videoLanguages: null | 40 | videoLanguages: null |
40 | }) | 41 | }) |
41 | 42 | ||
@@ -57,6 +58,7 @@ export class MyAccountVideoSettingsComponent extends FormReactive implements OnI | |||
57 | nsfwPolicy: this.user.nsfwPolicy, | 58 | nsfwPolicy: this.user.nsfwPolicy, |
58 | webTorrentEnabled: this.user.webTorrentEnabled, | 59 | webTorrentEnabled: this.user.webTorrentEnabled, |
59 | autoPlayVideo: this.user.autoPlayVideo === true, | 60 | autoPlayVideo: this.user.autoPlayVideo === true, |
61 | autoPlayNextVideo: this.user.autoPlayNextVideo, | ||
60 | videoLanguages | 62 | videoLanguages |
61 | }) | 63 | }) |
62 | }) | 64 | }) |
@@ -66,6 +68,7 @@ export class MyAccountVideoSettingsComponent extends FormReactive implements OnI | |||
66 | const nsfwPolicy = this.form.value[ 'nsfwPolicy' ] | 68 | const nsfwPolicy = this.form.value[ 'nsfwPolicy' ] |
67 | const webTorrentEnabled = this.form.value['webTorrentEnabled'] | 69 | const webTorrentEnabled = this.form.value['webTorrentEnabled'] |
68 | const autoPlayVideo = this.form.value['autoPlayVideo'] | 70 | const autoPlayVideo = this.form.value['autoPlayVideo'] |
71 | const autoPlayNextVideo = this.form.value['autoPlayNextVideo'] | ||
69 | 72 | ||
70 | let videoLanguages: string[] = this.form.value['videoLanguages'] | 73 | let videoLanguages: string[] = this.form.value['videoLanguages'] |
71 | if (Array.isArray(videoLanguages)) { | 74 | if (Array.isArray(videoLanguages)) { |
@@ -84,6 +87,7 @@ export class MyAccountVideoSettingsComponent extends FormReactive implements OnI | |||
84 | nsfwPolicy, | 87 | nsfwPolicy, |
85 | webTorrentEnabled, | 88 | webTorrentEnabled, |
86 | autoPlayVideo, | 89 | autoPlayVideo, |
90 | autoPlayNextVideo, | ||
87 | videoLanguages | 91 | videoLanguages |
88 | } | 92 | } |
89 | 93 | ||