LoginSignup
7
7

More than 5 years have passed since last update.

Everyplayプレハブ生成直後の録画可能端末の判定

Posted at

録画をサポートしている端末のみ表示したいUIがあったので簡単に対応しようとした所、
IsRecordingSupported()の挙動について微妙にハマったのでメモ程度に書いておく。

RecTest.cs
void Start()
{
  if( Everyplay.SharedInstance.IsRecordingSupported() )
  {
    // UI表示処理
  }
}

このような形で実装していたのだが、対応端末でもUIが表示されなかった。

公式のドキュメントを見ても特に注意事項などが記述されていなかったので少し調べた所、
ReadyForRecordingのイベントを待ってから参照すれば良い的な事が書かれていた。

RecTest.cs
void OnEnable()
{
  Everyplay.SharedInstance.ReadyForRecording += this.OnReadyForRecording;
}

void OnDisable()
{
  Everyplay.SharedInstance.ReadyForRecording -= this.OnReadyForRecording;
}

void OnReadyForRecording()
{
  if( Everyplay.SharedInstance.IsRecordingSupported() )
  {
    // UI表示処理
  }
}

非対応端末でUIが表示されず、対応端末でUIが表示されたので多分大丈夫っぽい。

参考: http://stackoverflow.com/questions/22898985/everyplay-isrecordingsupported-is-false-on-android-nexus-5

7
7
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
7
7