陈剑华

Merge remote-tracking branch 'origin/main'

@@ -114,8 +114,6 @@ export struct MultiPictureDetailItemComponent { @@ -114,8 +114,6 @@ export struct MultiPictureDetailItemComponent {
114 calcImageDefaultSize(imageWHRatio: number, size: window.Size): image.Size { 114 calcImageDefaultSize(imageWHRatio: number, size: window.Size): image.Size {
115 let width = 0 115 let width = 0
116 let height = 0; 116 let height = 0;
117 - // width = size.width;  
118 - // height = size.width / imageWHRatio;  
119 if (imageWHRatio > size.width / size.height) { 117 if (imageWHRatio > size.width / size.height) {
120 // 图片宽高比大于屏幕宽高比,图片默认以屏幕宽度进行显示 118 // 图片宽高比大于屏幕宽高比,图片默认以屏幕宽度进行显示
121 width = size.width; 119 width = size.width;
@@ -20,8 +20,15 @@ export struct CommentListDialogView { @@ -20,8 +20,15 @@ export struct CommentListDialogView {
20 onClose?: () => void 20 onClose?: () => void
21 onHeightDidChange?: Callback<number> 21 onHeightDidChange?: Callback<number>
22 22
  23 + @StorageProp('currentBreakpoint') currentBreakpoint: string = 'sm';
  24 + @State isPad:boolean = this.currentBreakpoint == "md" || this.currentBreakpoint == "lg"?true:false
  25 +
23 aboutToAppear(): void { 26 aboutToAppear(): void {
24 - this.maxHeight = this.windowHeight - this.windowWidth * 9 / 16 27 + if (this.isPad) {
  28 + this.maxHeight = this.windowHeight * 0.6
  29 + }else {
  30 + this.maxHeight = this.windowHeight - this.windowWidth * 9 / 16
  31 + }
25 } 32 }
26 33
27 build() { 34 build() {
@@ -24,9 +24,12 @@ export struct PlayerFullScreenView { @@ -24,9 +24,12 @@ export struct PlayerFullScreenView {
24 @State endX: number = 0 24 @State endX: number = 0
25 @State panDirection: number = 1 //1左滑 2右滑 25 @State panDirection: number = 1 //1左滑 2右滑
26 private panDistance: number = 0 26 private panDistance: number = 0
27 - private touchDownX: number = 0  
28 - private touchUpX: number = 0  
29 - @State isTouched: boolean = false 27 + // 用于触发拖动手势事件,滑动的最小距离为5vp时拖动手势识别成功。
  28 + private panOptionBright: PanGestureOptions = new PanGestureOptions({ direction: PanDirection.Vertical });
  29 + private panOptionVolume: PanGestureOptions = new PanGestureOptions({ direction: PanDirection.Vertical });
  30 + @Provide isShowVolume: boolean = false;
  31 + @Provide isShowBright: boolean = false;
  32 + @Provide volumeProgress: number = 1;
30 33
31 getTitle() { 34 getTitle() {
32 return this.contentDetailData?.newsTitle 35 return this.contentDetailData?.newsTitle
@@ -54,6 +57,15 @@ export struct PlayerFullScreenView { @@ -54,6 +57,15 @@ export struct PlayerFullScreenView {
54 }, 5000) 57 }, 5000)
55 // 初始显示 58 // 初始显示
56 this.updateProgress() 59 this.updateProgress()
  60 +
  61 + if (this.playerController) {
  62 + this.playerController.onVolumeUpdate = (volume) => {
  63 + this.volumeProgress = volume;
  64 + }
  65 + this.playerController.onBrightUpdate = (volume) => {
  66 + this.volumeProgress = volume;
  67 + }
  68 + }
57 } 69 }
58 70
59 aboutToDisappear(): void { 71 aboutToDisappear(): void {
@@ -63,24 +75,36 @@ export struct PlayerFullScreenView { @@ -63,24 +75,36 @@ export struct PlayerFullScreenView {
63 75
64 restartTimer() { 76 restartTimer() {
65 clearInterval(this.timer) 77 clearInterval(this.timer)
66 - this.showOperator = true  
67 this.timer = setInterval(() => { 78 this.timer = setInterval(() => {
68 this.showOperator = false 79 this.showOperator = false
69 }, 5000) 80 }, 5000)
70 } 81 }
71 82
72 build() { 83 build() {
73 - Stack() { 84 + Stack({ alignContent: Alignment.Center }) {
74 Row() { 85 Row() {
75 - }.height('100%').width('100%')  
76 - .onClick(() => {  
77 - this.restartTimer()  
78 - })  
79 -  
80 - this.headerBuilder()  
81 - this.middleSlideBuilder()  
82 - // this.middleContainerBuilder()  
83 - this.bottomBuilder() 86 + Column() {
  87 + this.leftMiddleRightSlideBuilder()
  88 + this.headerBuilder()
  89 + this.bottomBuilder()
  90 + }
  91 + .height('100%')
  92 + .width('100%')
  93 + .zIndex(1)
  94 + .gesture(TapGesture({ count: 1 })
  95 + .onAction((event: GestureEvent) => {
  96 + this.showOperator = !this.showOperator
  97 + this.restartTimer()
  98 + }))
  99 + .gesture(TapGesture({ count: 2 })
  100 + .onAction((event: GestureEvent) => {
  101 + // TODO 双击点赞|收藏
  102 + }))
  103 + }
  104 + .height('100%')
  105 + .width('100%')
  106 + this.volumeProgressBuilder()
  107 + this.brightProgressBuilder()
84 } 108 }
85 .zIndex(99999) 109 .zIndex(99999)
86 .height('100%') 110 .height('100%')
@@ -89,6 +113,128 @@ export struct PlayerFullScreenView { @@ -89,6 +113,128 @@ export struct PlayerFullScreenView {
89 } 113 }
90 114
91 @Builder 115 @Builder
  116 + leftMiddleRightSlideBuilder() {
  117 + Row() {
  118 + Column()
  119 + .width('20%')
  120 + .height('100%')
  121 + .gesture(
  122 + PanGesture(this.panOptionBright)
  123 + .onActionStart((event?: GestureEvent) => {
  124 + console.log(TAG, 'onActionEnd this.panOptionBright')
  125 + this.isShowBright = true
  126 + this.playerController?.onBrightActionStart(event!);
  127 + })
  128 + .onActionUpdate((event?: GestureEvent) => {
  129 + this.playerController?.onBrightActionUpdate(event!);
  130 + })
  131 + .onActionEnd(() => {
  132 + setTimeout(() => {
  133 + this.isShowBright = false
  134 + }, 500)
  135 + this.playerController?.onActionEnd();
  136 + })
  137 + )
  138 + Column() {
  139 + this.middleSlideBuilder()
  140 + }
  141 + .width('60%')
  142 + .height('100%')
  143 + Column()
  144 + .width('20%')
  145 + .height('100%')
  146 + .gesture(
  147 + PanGesture(this.panOptionVolume)
  148 + .onActionStart((event?: GestureEvent) => {
  149 + // console.log(TAG, 'onActionEnd this.panOptionVolume')
  150 + this.isShowVolume = true
  151 + this.playerController?.onVolumeActionStart(event!);
  152 + })
  153 + .onActionUpdate((event?: GestureEvent) => {
  154 + this.playerController?.onVolumeActionUpdate(event!);
  155 + })
  156 + .onActionEnd(() => {
  157 + setTimeout(() => {
  158 + this.isShowVolume = false
  159 + }, 500)
  160 + this.playerController?.onActionEnd();
  161 + })
  162 + )
  163 + }
  164 + .width('100%')
  165 + }
  166 +
  167 + @Builder
  168 + volumeProgressBuilder() {
  169 + Row() {
  170 + Image(this.volumeProgress == 0 ? $r('app.media.ic_volume_mute') : $r('app.media.ic_volume'))
  171 + .width(20)
  172 + .height(20)
  173 + .margin({
  174 + right: 8
  175 + })
  176 + Slider({
  177 + value: this.volumeProgress * 100,
  178 + step: 0.01,
  179 + style: SliderStyle.NONE
  180 + })
  181 + .width(132)
  182 + .height(2)
  183 + .zIndex(2)
  184 + .trackColor($r('app.color.pause_track_color'))
  185 + .selectedColor($r('app.color.pause_selected_color'))
  186 + .sliderInteractionMode(SliderInteraction.SLIDE_ONLY)
  187 + }
  188 + .width(204)
  189 + .height(32)
  190 + .borderRadius(16)
  191 + .padding({
  192 + top: 4,
  193 + bottom: 4,
  194 + left: 16,
  195 + right: 24
  196 + })
  197 + .backgroundColor('rgba(0, 0, 0, 0.4)')
  198 + .justifyContent(FlexAlign.Center)
  199 + .visibility(this.isShowVolume ? Visibility.Visible : Visibility.None)
  200 + }
  201 +
  202 + @Builder
  203 + brightProgressBuilder() {
  204 + Row() {
  205 + Image($r('app.media.ic_bright'))
  206 + .width(20)
  207 + .height(20)
  208 + .margin({
  209 + right: 8
  210 + })
  211 + Slider({
  212 + value: this.volumeProgress * 100,
  213 + step: 0.01,
  214 + style: SliderStyle.NONE
  215 + })
  216 + .width(132)
  217 + .height(2)
  218 + .zIndex(2)
  219 + .trackColor($r('app.color.pause_track_color'))
  220 + .selectedColor($r('app.color.pause_selected_color'))
  221 + .sliderInteractionMode(SliderInteraction.SLIDE_ONLY)
  222 + }
  223 + .width(204)
  224 + .height(32)
  225 + .borderRadius(16)
  226 + .padding({
  227 + top: 4,
  228 + bottom: 4,
  229 + left: 16,
  230 + right: 24
  231 + })
  232 + .backgroundColor('rgba(0, 0, 0, 0.4)')
  233 + .justifyContent(FlexAlign.Center)
  234 + .visibility(this.isShowBright ? Visibility.Visible : Visibility.None)
  235 + }
  236 +
  237 + @Builder
92 headerBuilder() { 238 headerBuilder() {
93 Row() { 239 Row() {
94 Row() { 240 Row() {
@@ -159,12 +305,14 @@ export struct PlayerFullScreenView { @@ -159,12 +305,14 @@ export struct PlayerFullScreenView {
159 .onClick(() => { 305 .onClick(() => {
160 // console.log(TAG, `ic_play_2 onClick`, this.status ) 306 // console.log(TAG, `ic_play_2 onClick`, this.status )
161 this.playerController?.switchPlayOrPause() 307 this.playerController?.switchPlayOrPause()
  308 + this.status = PlayerConstants.STATUS_START
162 }) 309 })
163 Image($r(`app.media.ic_pause_2`)).height(24).width(24) 310 Image($r(`app.media.ic_pause_2`)).height(24).width(24)
164 .visibility(this.status === PlayerConstants.STATUS_PAUSE ? Visibility.None : Visibility.Visible) 311 .visibility(this.status === PlayerConstants.STATUS_PAUSE ? Visibility.None : Visibility.Visible)
165 .onClick(() => { 312 .onClick(() => {
166 // console.log(TAG, `ic_pause_2 onClick`, this.status ) 313 // console.log(TAG, `ic_pause_2 onClick`, this.status )
167 this.playerController?.switchPlayOrPause() 314 this.playerController?.switchPlayOrPause()
  315 + this.status = PlayerConstants.STATUS_PAUSE
168 }) 316 })
169 317
170 Text(this.upProVal) 318 Text(this.upProVal)
@@ -308,49 +456,18 @@ export struct PlayerFullScreenView { @@ -308,49 +456,18 @@ export struct PlayerFullScreenView {
308 .width('100%') 456 .width('100%')
309 .height('100%') 457 .height('100%')
310 .onChange((value: number, mode: SliderChangeMode) => { 458 .onChange((value: number, mode: SliderChangeMode) => {
311 - // if (this.isTouched) {  
312 - // return  
313 - // }  
314 this.progressVal = value 459 this.progressVal = value
315 - // console.log('cj2024 onChange slider value:', value) 460 + this.showOperator = true
  461 + // console.log(TAG, 'onChange slider value:', value)
316 if (mode === SliderChangeMode.Moving) { 462 if (mode === SliderChangeMode.Moving) {
317 this.isDragging = true 463 this.isDragging = true
318 } 464 }
319 if (mode === SliderChangeMode.End) { 465 if (mode === SliderChangeMode.End) {
  466 + this.restartTimer()
320 this.isDragging = false 467 this.isDragging = false
321 this.playerController?.setSeekTime(this.progressVal, SliderChangeMode.End); 468 this.playerController?.setSeekTime(this.progressVal, SliderChangeMode.End);
322 } 469 }
323 }) 470 })
324 }.margin({ top: 73, bottom: 73 }) 471 }.margin({ top: 73, bottom: 73 })
325 - .onTouch((event?: TouchEvent) => {  
326 - // console.log(`cj2024 onTouch isDragging = ${this.isDragging}`)  
327 - if (this.isDragging) {  
328 - return  
329 - }  
330 - if (event) {  
331 - if (event.type === TouchType.Down) {  
332 - // console.info(`cj2024 onTouch Down x=${event?.touches[0].x}`)  
333 - if (event?.touches.length > 0) {  
334 - this.touchDownX = event?.touches[0].x  
335 - }  
336 - clearInterval(this.timer)  
337 - }  
338 - if (event.type === TouchType.Up) {  
339 - // console.info(`cj2024 onTouch Up x=${event?.touches[0].x}`)  
340 - if (event?.touches.length > 0) {  
341 - this.touchUpX = event?.touches[0].x  
342 - this.isTouched = this.touchUpX == this.touchDownX ? true : false  
343 - }  
344 - if (this.showOperator == false) {  
345 - this.restartTimer();  
346 - } else {  
347 - // if (this.isTouched) {  
348 - this.showOperator = false  
349 - // }  
350 - // this.restartTimer();  
351 - }  
352 - }  
353 - }  
354 - })  
355 } 472 }
356 } 473 }
  1 +<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" fill="none" version="1.1" width="24" height="24" viewBox="0 0 24 24"><defs><clipPath id="master_svg0_13863_054207"><rect x="0" y="0" width="24" height="24" rx="0"/></clipPath></defs><g clip-path="url(#master_svg0_13863_054207)"><g><g><g><rect x="11.25" y="1.50048828125" width="1.5" height="2.5" rx="0.20000000298023224" fill="#FFFFFF" fill-opacity="1"/></g></g><g transform="matrix(0.7071067690849304,0.7071067690849304,-0.7071067690849304,0.7071067690849304,8.571029755170457,-12.24893618770875)"><g><rect x="18.8223876953125" y="4.2216796875" width="1.5" height="2.5" rx="0.20000000298023224" fill="#FFFFFF" fill-opacity="1"/></g></g><g transform="matrix(0,1,-1,0,33.9990234375,-11)"><g><rect x="22.24951171875" y="11.49951171875" width="1.5" height="2.5" rx="0.20000000298023224" fill="#FFFFFF" fill-opacity="1"/></g></g><g transform="matrix(-0.7071067690849304,0.7071067690849304,-0.7071067690849304,-0.7071067690849304,47.24796326266369,18.57085419842042)"><g><rect x="19.52880859375" y="19.0697021484375" width="1.5" height="2.5" rx="0.20000000298023224" fill="#FFFFFF" fill-opacity="1"/></g></g><g transform="matrix(-1,0,0,-1,25,44.9990234375)"><g><rect x="12.25" y="22.49951171875" width="1.5" height="2.5" rx="0.20000000298023224" fill="#FFFFFF" fill-opacity="1"/></g></g><g transform="matrix(-0.7071068286895752,-0.7071067094802856,0.7071067094802856,-0.7071068286895752,-5.569534533715341,37.24868722411338)"><g><rect x="4.6787109375" y="19.77685546875" width="1.5" height="2.5" rx="0.20000000298023224" fill="#FFFFFF" fill-opacity="1"/></g></g><g transform="matrix(0,-1,1,0,-10.99951171875,13.99951171875)"><g><rect x="1.25" y="12.49951171875" width="1.5" height="2.5" rx="0.20000000298023224" fill="#FFFFFF" fill-opacity="1"/></g></g><g transform="matrix(0.7071066498756409,-0.70710688829422,0.70710688829422,0.7071066498756409,-2.2488258001976646,4.429253726848401)"><g><rect x="3.97216796875" y="4.9302978515625" width="1.5" height="2.5" rx="0.20000000298023224" fill="#FFFFFF" fill-opacity="1"/></g></g></g><g><ellipse cx="12" cy="12" rx="5.5" ry="5.5" fill="#FFFFFF" fill-opacity="1"/></g></g></svg>
  1 +<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" fill="none" version="1.1" width="24" height="24" viewBox="0 0 24 24"><defs><clipPath id="master_svg0_13863_054208"><rect x="0" y="0" width="24" height="24" rx="0"/></clipPath></defs><g clip-path="url(#master_svg0_13863_054208)"><g><g><path d="M14.7395,2.3000410000000002Q9.105879999999999,6.9891,8.55184,7.45024C8.51231,7.48314,8.46376,7.50053,8.41233,7.50053Q7.84572,7.50044,3.219141,7.49976C3.0976259,7.49974,3,7.59824,3,7.71976L3,16.079700000000003C3,16.2012,3.0976429,16.2997,3.219141,16.2997Q8.49141,16.3,8.49141,16.3C8.49141,16.3,8.49248,16.3,8.49248,16.3Q8.49248,16.3,14.7396,21.5C14.8829,21.6193,15.1,21.5171,15.1,21.3306L15.1,2.469347C15.1,2.282884,14.8828,2.180755,14.7395,2.3000410000000002M19.2049,16.805500000000002C18.9178,16.5183,18.2758,15.8763,17.9631,15.5636C17.8692,15.4697,17.8781,15.3147,17.9786,15.2279C18.4241,14.8432,18.7884,14.3723,19.0489,13.8426C19.3462,13.2381,19.5007,12.5734,19.5,11.89975C19.5,10.42702,18.7768,9.12304,17.6645,8.32452C17.549599999999998,8.24204,17.5302,8.07039,17.630200000000002,7.97038C17.9568,7.64378,18.5997,7.00082,18.8795,6.72104C18.956400000000002,6.64417,19.0775,6.63112,19.1632,6.69798C19.9287,7.29505,20.5533,8.054369999999999,20.9918,8.92218C21.4582,9.845369999999999,21.7009,10.8654,21.7,11.89975C21.7,13.8537,20.8509,15.6093,19.5009,16.8181C19.4158,16.8943,19.2857,16.886200000000002,19.2049,16.805500000000002" fill="#FFFFFF" fill-opacity="1"/></g></g></g></svg>
  1 +<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" fill="none" version="1.1" width="24" height="24" viewBox="0 0 24 24"><defs><clipPath id="master_svg0_21334_091013"><rect x="0" y="0" width="24" height="24" rx="0"/></clipPath></defs><g clip-path="url(#master_svg0_21334_091013)"><g><g><path d="M10.55184,7.450458405447006L16.7395,2.300264605447006C16.8828,2.1809784054470063,17.1,2.2831074054470064,17.1,2.4695704054470062L17.1,14.575658405447006L9.68048,7.500638405447006L10.41233,7.500748405447006C10.46376,7.500758405447006,10.51231,7.483368405447006,10.55184,7.450458405447006ZM6.78191,7.500208405447006L5.219141,7.499978405447006C5.0976259,7.499968405447007,5,7.598468405447006,5,7.719978405447006L5,16.07995840544701C5,16.201458405447006,5.0976429,16.299958405447008,5.219141,16.299958405447008L10.49141,16.300258405447007L10.49248,16.300258405447007L16.7396,21.500258405447006C16.8829,21.619458405447006,17.1,21.517358405447006,17.1,21.330858405447007L17.1,17.33915840544701L6.78191,7.500208405447006Z" fill-rule="evenodd" fill="#FFFFFF" fill-opacity="1"/></g></g><g transform="matrix(0.7237114310264587,0.6901028156280518,-0.6901028156280518,0.723711371421814,3.2684092820854858,-1.7144847984891385)"><line x1="3.775390625" y1="2.724609375" x2="29.231157302856445" y2="2.724609375" fill-opacity="0" stroke-opacity="1" stroke="#FFFFFF" fill="none" stroke-width="1"/></g></g></svg>
@@ -4,7 +4,7 @@ import { PlayerConstants, AVPlayerStatus, Events } from '../constants/PlayerCons @@ -4,7 +4,7 @@ import { PlayerConstants, AVPlayerStatus, Events } from '../constants/PlayerCons
4 import { BusinessError } from '@ohos.base'; 4 import { BusinessError } from '@ohos.base';
5 import { TrackingPlay } from 'wdTracking/Index'; 5 import { TrackingPlay } from 'wdTracking/Index';
6 import { ParamType } from 'wdTracking/Index'; 6 import { ParamType } from 'wdTracking/Index';
7 -import { DateTimeUtils, Logger } from 'wdKit/Index'; 7 +import { DateTimeUtils, Logger, WindowModel } from 'wdKit/Index';
8 import { BackgroundAudioController } from './BackgroundAudioController'; 8 import { BackgroundAudioController } from './BackgroundAudioController';
9 import { audio } from '@kit.AudioKit'; 9 import { audio } from '@kit.AudioKit';
10 10
@@ -37,6 +37,7 @@ export class WDPlayerController { @@ -37,6 +37,7 @@ export class WDPlayerController {
37 public onLoaded?: (loaded: number) => void; 37 public onLoaded?: (loaded: number) => void;
38 public onTimeUpdate?: (position: number, duration: number) => void; 38 public onTimeUpdate?: (position: number, duration: number) => void;
39 public onVolumeUpdate?: (volume: number) => void; 39 public onVolumeUpdate?: (volume: number) => void;
  40 + public onBrightUpdate?: (volume: number) => void;
40 public continue?: () => void; 41 public continue?: () => void;
41 public onCanplay?: () => void; 42 public onCanplay?: () => void;
42 public onStatusChange?: (status: number) => void; 43 public onStatusChange?: (status: number) => void;
@@ -45,6 +46,7 @@ export class WDPlayerController { @@ -45,6 +46,7 @@ export class WDPlayerController {
45 public videoWidth: number = 0 46 public videoWidth: number = 0
46 public videoHeight: number = 0 47 public videoHeight: number = 0
47 public keepOnBackground = false 48 public keepOnBackground = false
  49 + private windowHeight: number = px2vp(AppStorage.get<number>('windowHeight') || 0)
48 50
49 51
50 52
@@ -422,10 +424,6 @@ export class WDPlayerController { @@ -422,10 +424,6 @@ export class WDPlayerController {
422 } 424 }
423 } 425 }
424 426
425 - setBright() {  
426 - // globalThis.windowClass.setWindowBrightness(this.playerThis.bright)  
427 - }  
428 -  
429 getStatus() { 427 getStatus() {
430 return this.status; 428 return this.status;
431 } 429 }
@@ -465,14 +463,14 @@ export class WDPlayerController { @@ -465,14 +463,14 @@ export class WDPlayerController {
465 } 463 }
466 464
467 onVolumeActionStart(event: GestureEvent) { 465 onVolumeActionStart(event: GestureEvent) {
468 - this.positionY = event.offsetY;  
469 - }  
470 -  
471 - onBrightActionStart(event: GestureEvent) { 466 + if (!event) {
  467 + return;
  468 + }
472 this.positionY = event.offsetY; 469 this.positionY = event.offsetY;
473 } 470 }
474 471
475 volume: number = 1 472 volume: number = 1
  473 + bright: number = 1
476 474
477 onVolumeActionUpdate(event: GestureEvent) { 475 onVolumeActionUpdate(event: GestureEvent) {
478 if (!this.avPlayer) { 476 if (!this.avPlayer) {
@@ -481,7 +479,7 @@ export class WDPlayerController { @@ -481,7 +479,7 @@ export class WDPlayerController {
481 if (PlayerConstants.OPERATE_STATE.indexOf(this.avPlayer.state) === -1) { 479 if (PlayerConstants.OPERATE_STATE.indexOf(this.avPlayer.state) === -1) {
482 return; 480 return;
483 } 481 }
484 - let changeVolume = (event.offsetY - this.positionY) / 300; 482 + let changeVolume = (event.offsetY - this.positionY) / this.windowHeight;
485 let currentVolume = this.volume - changeVolume; 483 let currentVolume = this.volume - changeVolume;
486 if (currentVolume > 1) { 484 if (currentVolume > 1) {
487 currentVolume = 1; 485 currentVolume = 1;
@@ -490,26 +488,47 @@ export class WDPlayerController { @@ -490,26 +488,47 @@ export class WDPlayerController {
490 currentVolume = 0; 488 currentVolume = 0;
491 } 489 }
492 this.volume = currentVolume; 490 this.volume = currentVolume;
  491 + // Logger.debug(TAG, "changeVolume : " + changeVolume)
  492 + // Logger.debug(TAG, "windowHeight : " + this.windowHeight)
  493 + // Logger.debug(TAG, "volume : " + this.volume)
493 this.avPlayer?.setVolume(this.volume); 494 this.avPlayer?.setVolume(this.volume);
494 this.positionY = event.offsetY; 495 this.positionY = event.offsetY;
495 if (this.onVolumeUpdate) { 496 if (this.onVolumeUpdate) {
496 this.onVolumeUpdate(this.volume); 497 this.onVolumeUpdate(this.volume);
497 } 498 }
498 - Logger.debug(TAG, "volume : " + this.volume) 499 + }
  500 +
  501 + onBrightActionStart(event: GestureEvent) {
  502 + if (!event) {
  503 + return;
  504 + }
  505 + this.positionY = event.offsetY;
  506 + }
  507 +
  508 + setBright() {
  509 + const windowClass = WindowModel.shared.getWindowClass();
  510 + windowClass.setWindowBrightness(this.bright)
499 } 511 }
500 512
501 onBrightActionUpdate(event: GestureEvent) { 513 onBrightActionUpdate(event: GestureEvent) {
502 - // if (!this.playerThis.volumeShow) {  
503 - // this.playerThis.brightShow = true;  
504 - // let changeBright = (this.positionY - event.offsetY) / globalThis.screenHeight;  
505 - // let currentBright = this.playerThis.bright + changeBright;  
506 - // let brightMinFlag = currentBright <= 0;  
507 - // let brightMaxFlag = currentBright > 1;  
508 - // this.playerThis.bright = brightMinFlag ? 0 :  
509 - // (brightMaxFlag ? 1 : currentBright);  
510 - // this.setBright();  
511 - // this.positionY = event.offsetY;  
512 - // } 514 +
  515 + let changeBright = (event.offsetY - this.positionY) / this.windowHeight;
  516 + let currentBright = this.bright - changeBright;
  517 + if (currentBright > 1) {
  518 + currentBright = 1;
  519 + }
  520 + if (currentBright <= 0.1) {
  521 + currentBright = 0.1;
  522 + }
  523 + this.bright = currentBright;
  524 + // Logger.debug(TAG, "changeBright : " + changeBright)
  525 + // Logger.debug(TAG, "windowHeight : " + this.windowHeight)
  526 + // Logger.debug(TAG, "bright : " + this.bright)
  527 + this.setBright()
  528 + this.positionY = event.offsetY;
  529 + if (this.onBrightUpdate) {
  530 + this.onBrightUpdate(this.bright);
  531 + }
513 } 532 }
514 533
515 onActionEnd() { 534 onActionEnd() {