Skip to content

Commit e7f9799

Browse files
Merge pull request #250 from TakayukiHoshi1984/bugfix_host_light
iPad mini等、ライト非対応機種で、ライト機能を動かすと異常終了する不具合を修正。
2 parents aea0825 + 9eb5a4c commit e7f9799

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

  • dConnectDevicePlugin/dConnectDeviceHost/dConnectDeviceHost/Classes

dConnectDevicePlugin/dConnectDeviceHost/dConnectDeviceHost/Classes/DPHostService.m

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,13 @@ - (instancetype) initWithFileManager: (DConnectFileManager *) fileMgr plugin: (i
5757
[self addProfile:[DPHostCanvasProfile new]];
5858
[self addProfile:[DPHostTouchProfile new]];
5959
[self addProfile:[DPHostGeolocationProfile new]];
60-
[self addProfile:[DPHostLightProfile new]];
60+
61+
AVCaptureDevice *captureDevice = [AVCaptureDevice defaultDeviceWithMediaType:AVMediaTypeVideo];
62+
if ([captureDevice isTorchAvailable]
63+
&& [captureDevice isTorchModeSupported:AVCaptureTorchModeOn]
64+
&& [captureDevice isTorchModeSupported:AVCaptureTorchModeOff]) {
65+
[self addProfile:[DPHostLightProfile new]];
66+
}
6167
}
6268
return self;
6369
}

0 commit comments

Comments
 (0)