diff options
author | Rigel Kent <sendmemail@rigelk.eu> | 2018-10-05 15:17:34 +0200 |
---|---|---|
committer | Rigel Kent <sendmemail@rigelk.eu> | 2018-10-13 11:53:42 +0200 |
commit | 64cc5e8575fda47b281ae20abf0020e27fc8ce7c (patch) | |
tree | c3ec40b03d3fdc5d3beee9ff089384c894d9efe9 /client/src/app/+my-account | |
parent | 0e5ff97f6fdf9a4cebe5a15f5a390380465803ad (diff) | |
download | PeerTube-64cc5e8575fda47b281ae20abf0020e27fc8ce7c.tar.gz PeerTube-64cc5e8575fda47b281ae20abf0020e27fc8ce7c.tar.zst PeerTube-64cc5e8575fda47b281ae20abf0020e27fc8ce7c.zip |
add webtorrent opt-out settings
- add a key in localstorage to remember the opt-out
- add a user setting
Diffstat (limited to 'client/src/app/+my-account')
2 files changed, 16 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 96629940f..adbb97f00 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 | |||
@@ -15,6 +15,18 @@ | |||
15 | </div> | 15 | </div> |
16 | </div> | 16 | </div> |
17 | 17 | ||
18 | <div class="form-group"> | ||
19 | <label i18n for="webTorrentPolicy">Policy regarding P2P technologies</label> | ||
20 | |||
21 | <div class="peertube-select-container"> | ||
22 | <select id="webTorrentPolicy" formControlName="webTorrentPolicy"> | ||
23 | <option i18n value="enable">Enable WebTorrent</option> | ||
24 | <option i18n value="disable">Disable WebTorrent globally</option> | ||
25 | <option i18n value="disable_on_mobile" disabled>Disable WebTorrent on mobile devices (not yet available)</option> | ||
26 | </select> | ||
27 | </div> | ||
28 | </div> | ||
29 | |||
18 | <my-peertube-checkbox | 30 | <my-peertube-checkbox |
19 | inputName="autoPlayVideo" formControlName="autoPlayVideo" | 31 | inputName="autoPlayVideo" formControlName="autoPlayVideo" |
20 | i18n-labelText labelText="Automatically plays video" | 32 | i18n-labelText labelText="Automatically plays video" |
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 7089b2057..9e711a227 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 | |||
@@ -29,12 +29,14 @@ export class MyAccountVideoSettingsComponent extends FormReactive implements OnI | |||
29 | ngOnInit () { | 29 | ngOnInit () { |
30 | this.buildForm({ | 30 | this.buildForm({ |
31 | nsfwPolicy: null, | 31 | nsfwPolicy: null, |
32 | webTorrentPolicy: null, | ||
32 | autoPlayVideo: null | 33 | autoPlayVideo: null |
33 | }) | 34 | }) |
34 | 35 | ||
35 | this.userInformationLoaded.subscribe(() => { | 36 | this.userInformationLoaded.subscribe(() => { |
36 | this.form.patchValue({ | 37 | this.form.patchValue({ |
37 | nsfwPolicy: this.user.nsfwPolicy, | 38 | nsfwPolicy: this.user.nsfwPolicy, |
39 | webTorrentPolicy: this.user.webTorrentPolicy, | ||
38 | autoPlayVideo: this.user.autoPlayVideo === true | 40 | autoPlayVideo: this.user.autoPlayVideo === true |
39 | }) | 41 | }) |
40 | }) | 42 | }) |
@@ -42,9 +44,11 @@ export class MyAccountVideoSettingsComponent extends FormReactive implements OnI | |||
42 | 44 | ||
43 | updateDetails () { | 45 | updateDetails () { |
44 | const nsfwPolicy = this.form.value['nsfwPolicy'] | 46 | const nsfwPolicy = this.form.value['nsfwPolicy'] |
47 | const webTorrentPolicy = this.form.value['webTorrentPolicy'] | ||
45 | const autoPlayVideo = this.form.value['autoPlayVideo'] | 48 | const autoPlayVideo = this.form.value['autoPlayVideo'] |
46 | const details: UserUpdateMe = { | 49 | const details: UserUpdateMe = { |
47 | nsfwPolicy, | 50 | nsfwPolicy, |
51 | webTorrentPolicy, | ||
48 | autoPlayVideo | 52 | autoPlayVideo |
49 | } | 53 | } |
50 | 54 | ||