@@ -162,8 +162,9 @@ def _configure_camera(self, start):
162
162
163
163
# Device Rotate
164
164
def on_size (self , instance , size ):
165
- self .stop_capture_video ()
166
- self ._configure_camera (False )
165
+ if self ._camera :
166
+ self .stop_capture_video ()
167
+ self ._configure_camera (False )
167
168
168
169
##################################
169
170
# Parse options
@@ -263,8 +264,8 @@ def capture_screenshot(self, location = '.', subdir = '', name = ''):
263
264
264
265
# Select back, front camera
265
266
def select_camera (self , facing ):
266
- facing = facing .lower ()
267
267
if self ._camera :
268
+ facing = facing .lower ()
268
269
if facing == 'toggle' :
269
270
if self .facing == 'back' :
270
271
self .facing = 'front'
@@ -281,7 +282,8 @@ def select_camera(self, facing):
281
282
self .stop_capture_video ()
282
283
self ._facing_ev = Clock .schedule_interval (
283
284
self .can_select_camera , 1 / 30 )
284
- return self .facing
285
+ facing = self .facing
286
+ return facing
285
287
286
288
def can_select_camera (self ,dt ):
287
289
if not self .capture_in_progress :
@@ -302,7 +304,8 @@ def flash(self):
302
304
else :
303
305
self .flash_state = 'off'
304
306
self .flash_state = self ._camera .flash (self .flash_state )
305
- return self .flash_state
307
+ return self .flash_state
308
+ return "off"
306
309
307
310
# if enable_focus_gesture == True, then this is called by a tap gesture
308
311
def focus (self , x , y ):
0 commit comments