Skip to content

[EN] Video Recording

ch.yang edited this page Aug 4, 2016 · 1 revision

Record Video

The Cafe widget offers a video recording button which allows users to records screens during gameplay.

This functionality has been supported since 1.7.0 of the NAVER Cafe SDK and works with Android 5.0 or later.

An image to be inserted

Grant Permissions

Write code below to add permissions in the Androidmanifest.xml file in order to use the video recording functionality.

<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.RECORD_AUDIO"/>

Enable the Video Recording

Use the setUseVideoRecord() method to specify whether this functionality is enabled.

public static void setUseVideoRecord(Activity activity, boolean use);

If the use parameter is set to true, the video record button will appear on the Cafe widget (default: false).

The video record button won't appear even though the use parameter is set to true with earlier versions of Android 5.0.

The following code shows an example of how to make the video recording enabled.

/**
 * Determine whether video recording is enabled.
 */
Glink.setUseVideoRecord(activity, true)

Listener for the Recording Completed

Use the setOnRecordFinishListener() method to add the listener (OnRecordFinishListener) for the recording completed so that tasks to be handled after video recording can be implemented.

public static void setOnRecordFinishListener(OnRecordFinishListener onRecordFinishListener);

The following code shows an example of how to implement this listener.

/**
 * Add the listener for the recording completed.
 */
Glink.setOnRecordFinishListener(new Glink.OnRecordFinishListener() {
    @Override public void onRecordFinished(String uri) {
      Glink.startVideoWrite(MainActivity.this, -1, "title", "subject", uri);
    }
  });

Other NAVER CAFE SDK Documents.

Unity

Unreal

Cocos-2dx

iOS

Clone this wiki locally