package com.kfzs.cfyl.share_library.util;

import android.app.Activity;
import android.content.Intent;

import com.alibaba.fastjson.JSONObject;
import com.sheep.gamegroup.model.entity.Video;

import java.io.Serializable;
import java.util.ArrayList;

/**
 * Created by realicing on 2018/12/6.
 * realicing@sina.com
 */
public class CallBackAPI {
    private static CallBackAPI instance = null;

    private CallBackAPI() {

    }

    public static CallBackAPI get() {
        if (instance == null)
            instance = new CallBackAPI();
        return instance;
    }

    //剪切视频并选择主题
    public void goCutVideo(Activity activity, Video video, ArrayList<String> arrayList) {
        Intent intent = new Intent();
        intent.setClassName("com.kfzs.cfyl.media", "com.kfzs.cfyl.media.activity.ActCutVideo");
        intent.putExtra(Integer.class.getSimpleName(), Constant.MEDIA_ACTION_CUT_VIDEO);
        intent.putExtra(String.class.getSimpleName(), JSONObject.toJSONString(video));
        intent.putExtra(ArrayList.class.getSimpleName(), arrayList);
        activity.startActivityForResult(intent, Constant.MEDIA_ACTION_CUT_VIDEO);
    }
    //编辑视频
    public void goEditVideo(Activity activity, Serializable data) {
        Intent intent = new Intent();
        intent.setClassName("com.kfzs.cfyl.media", "com.kfzs.cfyl.media.activity.ActEditVideo");
        intent.putExtra(Integer.class.getSimpleName(), Constant.MEDIA_ACTION_EDIT_VIDEO);
        intent.putExtra(Video.class.getSimpleName(), data);
        activity.startActivityForResult(intent, Constant.MEDIA_ACTION_EDIT_VIDEO);
    }
    //编辑视频
    public void goAct(Activity activity, String act) {
        Intent intent = new Intent();
        intent.setClassName("com.kfzs.cfyl.media", "com.kfzs.cfyl.media.activity."+act);
        activity.startActivityForResult(intent, Constant.MEDIA_ACTION_EDIT_VIDEO);
    }
}
