fix regression issues#232
Merged
Merged
Conversation
added 2 commits
November 2, 2021 20:09
oOJohn6Oo
reviewed
Nov 3, 2021
| private void startProgressTimer() { | ||
| final int result = (int) ((float) engine.getAudioMixingCurrentPosition() / (float) engine.getAudioFileInfo(Constant.URL_PLAY_AUDIO_FILES) * 100); | ||
| mixingProgressBar.setProgress(Long.valueOf(result).intValue()); | ||
| engine.getAudioFileInfo(Constant.URL_PLAY_AUDIO_FILES); |
Contributor
There was a problem hiding this comment.
- 崩溃是因为此方法是由
handler延迟执行,可能调用到这里engine = null,所以要加判空处理; - 另外因为音频时长是异步回调,这里最好判断下当前
duration或者Slider.max是否为0,否则可能出现初次播放进度条直接到最后的情况。
上面说的在 Sep 27, 2021 NMS-714 这次提交是已经做了的。
oOJohn6Oo
reviewed
Nov 3, 2021
| public void onRequestAudioFileInfo(AudioFileInfo info, int error) { | ||
| Log.d(TAG, "onRequestAudioFileInfo: "+info.durationMs); | ||
| handler.post(()-> mixingProgressBar.setMax(info.durationMs)); | ||
| if(info.durationMs > 0 && progressText.getText().equals("00:00")) { |
oOJohn6Oo
approved these changes
Nov 3, 2021
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.