none
求wp8.1 APPX 开启闪光灯手电筒例子 RRS feed

答案

  • 这个在lumia930上能执行,不报错。但是灯就是不亮,什么回事?

    你好 H-huihui,

    这个是已知的问题,我们从产品组那边得到了合理的解决方案。

    部分手机使用上述链接中的代码是可以打开闪光灯的,但是如果要保证对所有设备都支持,必须启动一个视频录制会话, 具体可以查看这个英文贴:https://social.msdn.microsoft.com/Forums/en-US/329c40e7-fa9a-4a27-8347-b4a80100842e/cant-turn-on-lumia-1520-wp-81-flashlight-use-videodevicecontrollertorchcontrol?forum=wpdevelop

    Alan_Yao 提供了关键代码:

    if (mc.VideoDeviceController.TorchControl.Supported)
    {
                    // But wait, for this to work with Blue camera drivers, we have to Start a recording session
                    // Create video encoding profile as MP4 
                    var videoEncodingProperties = MediaEncodingProfile.CreateMp4(VideoEncodingQuality.Vga);
    
                    // Start Video Recording
                    var videoStorageFile = await KnownFolders.VideosLibrary.CreateFileAsync("tempVideo.mp4", CreationCollisionOption.GenerateUniqueName);
                    await mc.StartRecordToStorageFileAsync(videoEncodingProperties, videoStorageFile);
    
                    // Turn on Torch                 
                    mc.VideoDeviceController.TorchControl.Enabled = true;
    
    }


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    2014年11月25日 2:11
    版主

全部回复