admin
2024-01-26 c2d382d99ca506932985d1843d4371d6ed0203ff
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
package com.yeshi.video.player.util;
 
import android.content.Context;
 
import com.lcjian.library.util.common.FileUtils;
import com.lcjian.library.util.common.StringUtils;
 
import java.io.IOException;
import java.io.InputStream;
 
/**
 * 播放器全屏
 */
public class PlayerFullScreenUtil {
 
    private static String getJSContent(Context context, String name) {
        try {
            InputStream inputStream = context.getAssets().open(name);
            return StringUtils.convertStreamToString(inputStream);
        } catch (IOException e) {
            e.printStackTrace();
        }
        return "";
    }
 
    /**
     * 风行全屏JS代码
     *
     * @return
     */
    public static String getFunShionFullScreenJS(Context context) {
        return getJSContent(context, "player_funshion.js");
    }
 
 
    /**
     * 获取Acfun全屏代码
     *
     * @return
     */
    public static String getAcfunFullScreenJS(Context context) {
        return getJSContent(context, "player_acfun.js");
    }
 
 
}