安裝高級定制播放器
高級定制播放器下載地址:https://download.csdn.net/download/ahphong/89360454
僅限用于PICO G2、G3、G4、NEO系列VR眼鏡上使用,
用途:用于第三方APP(開發者)調用定制播放器播放2D、3D、180°、360°全景視頻。
VR眼鏡系統請升級到最新版,可在官網下載,企業版用戶請當地Pico代理商/技術支持,獲取最新企業版系統升級固件。
NEO3企業版開發者,可以在文章結尾處下載系統固件。
接口和使用說明
1. 啟動播放器
package:com.picovr.wing.videoplayer
class:com.picovr.wing.videoplayer.UnityActivity
參數key | 類型 | value | 說明 |
---|---|---|---|
playcommand | String | playlist | 傳遞視頻列表 |
filelist | String | “/storage/emulated/0/Movies/ScreenRecording/test1.mp4,/storage/emulated/0/Movies/ScreenRecording/test2.mp4” | 視頻路徑 |
isControl | boolean | true or false | 啟動播放器后,是否可調出控制面板true:不可false:可 |
playMode | int | 參考playMode對應 | 參考playMode |
repeatMode | int | 1: 單曲循環, 2:列表循環, 3 :不循環 | 配置播放循環模式。(注,只有配置為3時,能收到end 廣播) |
seekPlay | boolean | true or false | 啟動視頻播放時,是否強制從頭播放。true 會直接seek到0.false則不處理 |
autoPlay | int | 0 或者不設置 | 啟動播放器時,是否暫停播放 |
2. 控制播放
切換模式
adb shell am broadcast -a com.picovr.wing.player.PLAY_CONTROL --es controltype “playcommand” --es mediatype “video” --es operation “playmode” --ei “playmode” 2
Intent intent = new Intent(com.picovr.wing.player.PLAY_CONTROL);
intent.setPackage("com.picovr.wing.videoplayer");
intent.putExtra("controltype", "playcommand");
intent.putExtra("mediatype", "video");
intent.putExtra("operation", "playmode");
intent.putExtra("playmode", 2);
getContext().sendBroadcast(intent);
播放或暫停
adb shell am broadcast -a com.picovr.wing.player.playorpause
Intent intent = new Intent("com.picovr.wing.player.playorpause");
intent.setPackage("com.picovr.wing.videoplayer");
getContext().sendBroadcast(intent);
退出播放器
adb shell am broadcast -a com.picovr.wing.player.exit
Intent intent = new Intent("com.picovr.wing.player.exit");
intent.setPackage("com.picovr.wing.videoplayer");
getContext().sendBroadcast(intent);
重新播放
adb shell am broadcast -a com.picovr.wing.player.PLAY_CONTROL --es controltype “playcommand” --es mediatype “video” --es operation “play”
Intent intent = new Intent(com.picovr.wing.player.PLAY_CONTROL);
intent.setPackage("com.picovr.wing.videoplayer");
intent.putExtra("controltype", &#