Open gnorbsl opened 9 years ago
I have the same issue, using a custom layout it works like a charm - just the default wants to play just once...
I added a pull request which should fix the issue.
Any news from jaydeepw? Seem he abandoned this project :(
Seeing same issue...somewhat of a hack but I copied aw_player.xml from this project (renamed audio_player.xml below) and called following. Ultimately needed to do something like this anyway to have better control over color of some of the controls (tinting based on Palette info taken from image).
View playerUi = getActivity().getLayoutInflater().inflate(R.layout.audio_player, appBarLayout);
View playView = playerUi.findViewById(R.id.play);
View pauseView = playerUi.findViewById(R.id.pause);
SeekBar seekBar = (SeekBar) playerUi.findViewById(R.id.media_seekbar);
TextView playbackTime = (TextView) playerUi.findViewById(R.id.playback_time);
AudioWife.getInstance().init(getContext(), Uri.parse(url))
.setPlayView(playView)
.setPauseView(pauseView)
.setSeekBar(seekBar)
.setPlaytime(playbackTime);
I added your player to an DialogFragment with
AudioWife.getInstance().init(getActivity(), uri).useDefaultUi((ViewGroup) rootView, inflater);
It works without a problem and I'm using release() in the onDestroy() method.
http://i.imgur.com/8vxt19m.png
But when I'm starting the fragment a second time, the playerview appears but doesn't show the time nor am I able to play the sound.
http://i.imgur.com/4N3GujQ.png
Any idea what could cause this?