Menu

Delphi Berlin (Update 1&2) - ios 10.2.1 camera not working

2017-02-22
2017-02-22
  • Anang Ganjar

    Anang Ganjar - 2017-02-22

    Hi,

    i have success install component on berlin update 1 & 2,
    and success test run demo app on device iphone 10.2.1
    but when try run avrecorder / video record is always closing, then i try run with debug and it break show on attach image!!
    any one have similar problem with me?
    or maybe i miss something

    Thanks

     

    Last edit: Anang Ganjar 2017-02-22
  • Anang Ganjar

    Anang Ganjar - 2017-02-26

    for naybody have same problem i have solved this (not prefect but work)
    the problem show on file DPF.iOS.Media.pas on line 515, you have to comment
    //if { FAudioRecordPermission and } ( TOSVersion.Major > 6 ) then
    //TAVAudioSession.Wrap( TAVAudioSession.OCClass.sharedInstance ).requestRecordPermission( PermissionBlock )
    //else
    //FAudioRecordPermission := false;

    then

    Copy the C:\Program Files (x86)\Embarcadero\Studio\15.0\source\rtl\ios\iOSapi.AVFoundation.pas into DPF source direction and rename it to iOSapi.AVFound.

    Then open iOSapi.AVFound and change the MacApi.dispatch to DPF.iOS.Dispatch

    Then in the DPF source directory, need to change the following files in the uses section from "iOSapi.AVFoundation" to "iOSapi.AVFound".

    These files are
    DPF.iOS.AVPlayer.pas
    DPF.iOS.AVFoundationConsts.pas
    DPF.iOS.Classes.pas
    DPF.iOS.Media.pas
    DPF.iOS.MediaPlayer.pas
    DPF.iOS.MPMoviePlayerViewController.pas
    DPF.iOS.MPVolume.pas
    DPF.iOS.SlideDialog.pas

    then stepdescribe on this link
    https://sourceforge.net/p/dpfdelphiios/discussion/general/thread/cf067b3f/?limit=25#19bc

    don't use TDPFCamera component at design but create at runtime on create
    example :
    DPFCamera1:=TDPFCamera.Create(Self);
    DPFCamera1.OnSampleBufferReady:=DPFCamera1SampleBufferReady;
    DPFCamera1.OnConvertComplete:=DPFCamera1ConvertComplete;
    DPFCamera1.OnConvertProgress:=DPFCamera1ConvertProgress;
    DPFCamera1.OnCaptureFinished:=DPFCamera1CaptureFinished;
    DPFCamera1.Preview:=DPFUIViewPreview;

    now video recording will work

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.