|
|
@ -53,6 +53,7 @@ import java.net.URI; |
|
|
import java.text.SimpleDateFormat; |
|
|
import java.text.SimpleDateFormat; |
|
|
import java.util.HashMap; |
|
|
import java.util.HashMap; |
|
|
import java.util.List; |
|
|
import java.util.List; |
|
|
|
|
|
import java.util.Map; |
|
|
import java.util.Scanner; |
|
|
import java.util.Scanner; |
|
|
import java.util.concurrent.Executors; |
|
|
import java.util.concurrent.Executors; |
|
|
import java.util.regex.Matcher; |
|
|
import java.util.regex.Matcher; |
|
|
@ -104,8 +105,8 @@ public class WebViewActivity extends BaseActivity { |
|
|
//static String HtmlUrl = "http://192.168.1.196:5173/";
|
|
|
//static String HtmlUrl = "http://192.168.1.196:5173/";
|
|
|
int time = 0; |
|
|
int time = 0; |
|
|
private VideoView currentVideo; |
|
|
private VideoView currentVideo; |
|
|
SocketClient localSocketClient; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private SocketClient localSocketClient; |
|
|
|
|
|
private Map<String, Uri> videoMap = new HashMap<>(); |
|
|
// 语音听写对象
|
|
|
// 语音听写对象
|
|
|
private ASR mAsr; |
|
|
private ASR mAsr; |
|
|
private boolean isrun = false; // 是否正在听写
|
|
|
private boolean isrun = false; // 是否正在听写
|
|
|
@ -170,6 +171,13 @@ public class WebViewActivity extends BaseActivity { |
|
|
binding.web.setBackgroundColor(0); |
|
|
binding.web.setBackgroundColor(0); |
|
|
binding.web.getBackground().setAlpha(0); |
|
|
binding.web.getBackground().setAlpha(0); |
|
|
|
|
|
|
|
|
|
|
|
Uri videoUri = Uri.parse("android.resource://" + getPackageName() + "/" + R.raw.bg); |
|
|
|
|
|
videoMap.put("hat_bg",videoUri); |
|
|
|
|
|
Uri videoUri1 = Uri.parse("android.resource://" + getPackageName() + "/" + R.raw.hello); |
|
|
|
|
|
videoMap.put("hat_hello",videoUri1); |
|
|
|
|
|
Uri videoUri2 = Uri.parse("android.resource://" + getPackageName() + "/" + R.raw.speek); |
|
|
|
|
|
videoMap.put("hat_speek",videoUri2); |
|
|
|
|
|
|
|
|
loadingbgVideo(true); |
|
|
loadingbgVideo(true); |
|
|
currentVideo = binding.bgVideo; |
|
|
currentVideo = binding.bgVideo; |
|
|
loadingHelloVideo(); |
|
|
loadingHelloVideo(); |
|
|
@ -185,8 +193,7 @@ public class WebViewActivity extends BaseActivity { |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
private void loadingbgVideo(Boolean isplay){ |
|
|
private void loadingbgVideo(Boolean isplay){ |
|
|
Uri videoUri = Uri.parse("android.resource://" + getPackageName() + "/" + R.raw.bg); |
|
|
|
|
|
binding.bgVideo.setVideoURI(videoUri); |
|
|
|
|
|
|
|
|
binding.bgVideo.setVideoURI(videoMap.get("hat_bg")); |
|
|
binding.bgVideo.setOnPreparedListener(new MediaPlayer.OnPreparedListener() { |
|
|
binding.bgVideo.setOnPreparedListener(new MediaPlayer.OnPreparedListener() { |
|
|
@Override |
|
|
@Override |
|
|
public void onPrepared(MediaPlayer mp) { |
|
|
public void onPrepared(MediaPlayer mp) { |
|
|
@ -203,8 +210,7 @@ public class WebViewActivity extends BaseActivity { |
|
|
}); |
|
|
}); |
|
|
} |
|
|
} |
|
|
private void loadingHelloVideo(){ |
|
|
private void loadingHelloVideo(){ |
|
|
Uri videoUri1 = Uri.parse("android.resource://" + getPackageName() + "/" + R.raw.hello); |
|
|
|
|
|
binding.helloVideo.setVideoURI(videoUri1); |
|
|
|
|
|
|
|
|
binding.helloVideo.setVideoURI(videoMap.get("hat_hello")); |
|
|
binding.helloVideo.setOnPreparedListener(new MediaPlayer.OnPreparedListener() { |
|
|
binding.helloVideo.setOnPreparedListener(new MediaPlayer.OnPreparedListener() { |
|
|
@Override |
|
|
@Override |
|
|
public void onPrepared(MediaPlayer mp) { |
|
|
public void onPrepared(MediaPlayer mp) { |
|
|
@ -221,8 +227,7 @@ public class WebViewActivity extends BaseActivity { |
|
|
}); |
|
|
}); |
|
|
} |
|
|
} |
|
|
private void loadingSpeekVideo(){ |
|
|
private void loadingSpeekVideo(){ |
|
|
Uri videoUri2 = Uri.parse("android.resource://" + getPackageName() + "/" + R.raw.speek); |
|
|
|
|
|
binding.speekVideo.setVideoURI(videoUri2); |
|
|
|
|
|
|
|
|
binding.speekVideo.setVideoURI(videoMap.get("hat_speek")); |
|
|
binding.speekVideo.setOnPreparedListener(new MediaPlayer.OnPreparedListener() { |
|
|
binding.speekVideo.setOnPreparedListener(new MediaPlayer.OnPreparedListener() { |
|
|
@Override |
|
|
@Override |
|
|
public void onPrepared(MediaPlayer mp) { |
|
|
public void onPrepared(MediaPlayer mp) { |
|
|
|