Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Everyplay window stops/pauses recording?

Discussion in 'Unity Everyplay' started by infinitypbr, Feb 11, 2015.

  1. infinitypbr

    infinitypbr

    Joined:
    Nov 28, 2012
    Posts:
    3,149
    Hello. I emailed this to support@everyplay.com but since there's a message saying to expect a delayed response, I figure I'll post it here for redundancy, just in case someone else has had the same problem. I'm implementing on iOS.

    1. I noticed that after I loaded the everyplay panel, the default one, if I closed (sharing or not) it, the video wouldn't resume recording. Is there a built in way to resume recording on close?

    2. Because of this, I moved the "StartRecording()/ResumeRecording()" function that I call at the start of each scene into the Update() loop rather than Start(). However now I'm getting the following error in Xcode, and the result is that Everyplay doesn't have my metadata that I'm passing in, or the video itself. (It's black, and clicking to view the vide3o just shows "processing").

    BSXPCMessage received error for message: Connection interrupted

    I don't get the error if I call my code (below) during the Start(). It records just fine, but after bringing up the Everyplay window, recording stops. I was hoping having the Update loop would resume recording after the Everyplay window is closed. Am I missing something?

    Thanks!!

    Andrew

    My code, in case I"m doing something wrong, run every frame. I pause recording before a new scene is loaded, to keep the "Loading" screen from being part of the video.

    Code (csharp):
    1.  
    2. function EveryplayActions(){
    3.    if (Everyplay.IsSupported())
    4.       {
    5.       if (!Everyplay.IsRecording())
    6.       {
    7.          print ("Everyplay is not Recording: Start Recording");
    8.          Everyplay.SetMaxRecordingMinutesLength(3);
    9.          Everyplay.StartRecording();
    10.       }
    11.       else if (Everyplay.IsPaused())
    12.       {
    13.          print ("Everyplay is Paused: Resume");
    14.          Everyplay.ResumeRecording();
    15.       }
    16.    }
    17. }
    18.  
     
  2. surathunity3d

    surathunity3d

    Moderator

    Joined:
    Sep 30, 2014
    Posts:
    128
    Hi @sfbaystudios

    I replied to your Ticket. Also, adding my comments here:

    1. I am assuming you are referring to Share Modal when you say "everyplay panel, the default one".
    If yes, then the answer is no. Recording can be only started by called StartRecording().
    It is good practice to wait for ReadyForRecording event, before you call StartRecording(). Otherwise, you might get black screen and other issues.
    Note: If you subscribe to that event after the event has actually triggered you might not get it. So better to use it and also check IsRecordingSupported() before StartRecording()
    For more information, please read under "Checking for Recording Support" here: https://developers.everyplay.com/documentation/Integrating-Everyplay-in-Unity3D.md

    2) This error (BSXPCMessage received error for message: Connection interrupted) does not affect Everyplay.
    - StartRecording() starts a brand new recording session. So Metadata will be wiped out.
    - So, you should NOT do StartRecording()/ResumeRecording(), instead do the following:
    StartRecording (before 1st level) - PauseRecording/ResumeRecording (in between levels) - StopRecording (after last level)
    - Also, instead of the snippet you shared for your Update(), consider using OnLevelWasLoaded (http://docs.unity3d.com/ScriptReference/MonoBehaviour.OnLevelWasLoaded.html) for calling ResumeRecording()

    Hope this helps!

    Cheers,
    Surath
     
  3. infinitypbr

    infinitypbr

    Joined:
    Nov 28, 2012
    Posts:
    3,149
    Hello,

    Let me see if this is better. Now on
    Code (csharp):
    1. OnLevelWasLoaded()
    of each new level, I subscribe:

    Code (csharp):
    1. Everyplay.ReadyForRecording += EveryPlayReadyForRecording;
    Also in
    Code (csharp):
    1. Start()
    I'm calling
    Code (csharp):
    1. EveryplayActions();
    because, as you mentioned, it's possible to miss it if I'm not subscribed when the Everyplay is ready. That seemed to have been happening, as I was not starting recording otherwise.

    For this:

    Code (csharp):
    1.  
    2. function EveryPlayReadyForRecording(ready : boolean){
    3.   if (ready)
    4.   {
    5.     EveryplayActions();
    6.   }
    7. }
    8.  
    9. functionEveryplayActions(){
    10.   if (Everyplay.IsSupported())
    11.   {
    12.     if (!Everyplay.IsRecording())
    13.     {
    14.       print ("EveryplayisnotRecording: StartRecording");
    15.       Everyplay.SetMaxRecordingMinutesLength(3);
    16.       Everyplay.StartRecording();
    17.     }
    18.     elseif (Everyplay.IsPaused())
    19.     {
    20.       print ("EveryplayisPaused: Resume");
    21.       Everyplay.ResumeRecording();
    22.     }
    23.   }
    24. }
    25.  
    However, nothing has changed. When the Sharing Modal is closed, recording does not resume, and I'm not receiving
    Everyplay.ReadyForRecording that i know of. [I'ts very possible I'm just doing it wrong!]

    Is there no way to know when the sharing modal is closed so I can resume recording or at least re-start it?
     
  4. surathunity3d

    surathunity3d

    Moderator

    Joined:
    Sep 30, 2014
    Posts:
    128
    Hi @sfbaystudios

    Thanks for your message.

    I still think there is a miscommunication going on. As I said before....

    - StartRecording() starts a brand new recording session. So Metadata will be wiped out.
    - So, you should NOT do StartRecording()/ResumeRecording(), instead do the following:
    - StartRecording (before 1st level)
    - PauseRecording/ResumeRecording (in between levels)
    - StopRecording (after last level)


    According to your code above, I can't see where you are calling PauseRecording.
    ResumeRecording will not work if recording is not paused.

    So Start works with Stop and Resume works with Pause.

    You can use WasClosed event to check whether Share Modal is closed.
    Please note, it gets triggered when any last modal of Everyplay is closed (could be some other component of Everyplay). However, it might be suitable for your requirement - considering in between levels, you won't have any other modal of Everyplay open other than Share Modal.

    Cheers
    Surath
     
  5. infinitypbr

    infinitypbr

    Joined:
    Nov 28, 2012
    Posts:
    3,149
    I'll see if I can implement changes to make it better -- using WasClosed sounds promising.

    I do PauseRecording() right before my "Loading" screen comes up, since that takes a good 10-15 seconds and is boring. That way the Start() code on the next scene will call ResumeRecording(). (If it weren't already recording, it'd call StartRecording()

    Question: Does opening the Share Modal cause StopRecording() to happen or PauseRecording()?
     
  6. surathunity3d

    surathunity3d

    Moderator

    Joined:
    Sep 30, 2014
    Posts:
    128
    Hi @sfbaystudios

    "Question: Does opening the Share Modal cause StopRecording() to happen or PauseRecording()?"
    - No, StopRecording or PauseRecording is not automatically triggered by Everyplay.

    Cheers
    Surath
     
  7. infinitypbr

    infinitypbr

    Joined:
    Nov 28, 2012
    Posts:
    3,149
    Hmm. Is there a way to find out why recording stops then? Because if I open the sharing modal in the game, and then close it, and then open it 10 seconds later, the video only shows the gameplay before the sharing modal was first opened.
     
  8. surathunity3d

    surathunity3d

    Moderator

    Joined:
    Sep 30, 2014
    Posts:
    128
    Hi @sfbaystudios

    Sorry, my bad :) I would have to correct myself (my previous reply). I was partially wrong.

    PauseRecording is not automatically triggered by Everyplay - Valid.
    BUT, StopRecording is auto called by Everyplay if you share without stopping.

    So, in that case, it starts a brand new session...which is what is happening in your case.

    Cheers
    Surath