Toggle flashlight in Windows Phone 8.1

前端 未结 5 1047
面向向阳花
面向向阳花 2020-12-11 07:30

Can anyone say how to toggle flashlight in Windows Phone 8.1 using C#? It seems like there are lots of API changes in Windows Phone 8.1 and most of the API\'s in WP 8.0 are

5条回答
  •  既然无缘
    2020-12-11 08:07

    Doesn't work on my Lumia 1520. You need to start video recording to get flashlight working:

            var videoEncodingProperties = MediaEncodingProfile.CreateMp4(VideoEncodingQuality.Vga);
    
            var videoStorageFile = await KnownFolders.VideosLibrary.CreateFileAsync("tempVideo.mp4", CreationCollisionOption.GenerateUniqueName);
            await captureManager.StartRecordToStorageFileAsync(videoEncodingProperties, videoStorageFile);
    

提交回复
热议问题