- Home /
Question by
jayasurya_98 · Aug 29, 2019 at 02:56 PM ·
iosreplay
Unable to Start Recording on Replay Kit (iOS 12)
I'm trying to start a screen recording with a UI button On click, in an AR app using Replay Kit. Both my iOS devices use (iOS 12.4.1). I'm using the following code but
the recording doesn't start and always results in No recording available.
bool canRecord;
bool recording;
string error = "";
private void Start()
{
if(!ReplayKit.APIAvailable)
{
Debug.Log("Replay Kit Not found or Enabled");
canRecord = false;
}
else
{
Debug.Log("Replay Kit is available");
canRecord = true;
}
recording = ReplayKit.isRecording;
}
public void StartRecording()
{
print("start recording clicked");
if(canRecord == true && recording != true)
{
try{
recording = !recording;
if(recording)
{
ReplayKit.StartRecording();
}
}
catch (Exception e)
{
error = e.ToString();
Debug.Log(error);
}
}
}
public void StopRecording()
{
print("stop recording clicked");
try
{
recording = !recording;
if(!recording)
{
if(ReplayKit.isRecording)
{
ReplayKit.StopRecording();
}
else
{
Debug.Log("Recording Didn't happen");
}
}
}
catch (Exception e)
{
error = e.ToString();
Debug.Log(error);
}
}
public void DiscardRecording()
{
try
{
print("discard clicked");
if (ReplayKit.recordingAvailable)
{
ReplayKit.Discard();
}
else
{
print("no recording available");
}
}
catch(Exception e)
{
error = e.ToString();
Debug.Log(error);
}
}
public void PreviewRecording()
{
try
{
print("preview clicked");
if (ReplayKit.recordingAvailable)
{
ReplayKit.Preview();
}
else
{
Debug.Log("no recording available");
}
}
catch(Exception e)
{
error = e.ToString();
Debug.Log(error);
}
}
Comment
Your answer
Follow this Question
Related Questions
No microphone sound in ReplayKit recording 0 Answers
The name 'Joystick' does not denote a valid type ('not found') 2 Answers
Customize ReplayKit.Preview - for iPhone X UI 1 Answer
No Audio in ReplayKit recording 2017.3.0f3 1 Answer
Error uploading to App Store, package filename invalid characters, ERROR ITMS-90328 1 Answer