Skip to content

Commit 763ae7e

Browse files
Merge pull request #164 from TakayukiHoshi1984/modity_host_light_control_timing
Hostプラグインのライトの点灯タイミングの修正
2 parents d9f7c39 + 50de0fb commit 763ae7e

2 files changed

Lines changed: 18 additions & 0 deletions

File tree

dConnectDevicePlugin/dConnectDeviceHost/dConnectDeviceHost/Classes/profile/DPHostMediaStreamRecording/DPHostMediaStreamRecordingProfile.m

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -482,6 +482,9 @@ - (instancetype)init
482482
[recorder.session startRunning];
483483
}
484484

485+
// ライトが点いていたら消灯する。
486+
[weakSelf setLightOff];
487+
485488
// 写真を撮影する。
486489
__block AVCaptureDevice *captureDevice = [AVCaptureDevice deviceWithUniqueID:recorder.videoDevice.uniqueId];
487490
NSError *error;
@@ -698,6 +701,9 @@ - (instancetype)init
698701
return;
699702
}
700703

704+
// ライトが点いていたら消灯する。
705+
[weakSelf setLightOff];
706+
701707
recorder.videoOrientation = [recorder.videoConnection videoOrientation];
702708

703709
AVCaptureDevice *captureDevice = [AVCaptureDevice deviceWithUniqueID:recorder.videoDevice.uniqueId];
@@ -2062,4 +2068,14 @@ - (void)deviceOrientationDidChange
20622068
}
20632069
}
20642070

2071+
- (void)setLightOff
2072+
{
2073+
AVCaptureDevice *captureDevice = [AVCaptureDevice defaultDeviceWithMediaType:AVMediaTypeVideo];
2074+
[captureDevice lockForConfiguration:NULL];
2075+
if (captureDevice.torchMode == AVCaptureTorchModeOn) {
2076+
captureDevice.torchMode = AVCaptureTorchModeOff;
2077+
}
2078+
[captureDevice unlockForConfiguration];
2079+
}
2080+
20652081
@end

dConnectSDK/dConnectBrowserForIOS9/dConnectBrowserForIOS9/Info.plist

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,8 @@
5959
<string>アプリ使用時のみ位置情報を使用します。</string>
6060
<key>NSMicrophoneUsageDescription</key>
6161
<string>電話をかけることができます。</string>
62+
<key>NSPhotoLibraryAddUsageDescription</key>
63+
<string>撮影した写真を保存します。</string>
6264
<key>NSPhotoLibraryUsageDescription</key>
6365
<string>写真を参照することができます。</string>
6466
<key>UILaunchStoryboardName</key>

0 commit comments

Comments
 (0)