File tree Expand file tree Collapse file tree 1 file changed +9
-6
lines changed
app/src/main/assets/js_injects Expand file tree Collapse file tree 1 file changed +9
-6
lines changed Original file line number Diff line number Diff line change 1
1
( function ( ) {
2
- var playButton = document . getElementById ( "play-icon" ) ;
3
- playButton . addEventListener ( "click" , function ( ) {
4
- var audioElement = document . querySelector ( "audio" ) ;
5
- var audioSource = audioElement . getAttribute ( "src" ) ;
6
- { { INTERFACE_EXPOSED_NAME } } . onPlayButtonClick ( audioSource ) ;
7
- audioElement . addEventListener ( "ended" , function ( ) {
2
+ $ ( ".audio-player-container, #audio-player-container" ) . each ( function ( ) {
3
+ container = $ ( this ) ;
4
+ var audioElem = container . find ( "audio" ) [ 0 ] ;
5
+ container . find ( ".play-icon,#play-icon" ) . on ( 'click' , function ( ) {
6
+ var audioSource = audioElem . getAttribute ( "src" ) ;
7
+ { { INTERFACE_EXPOSED_NAME } } . onPlayButtonClick ( audioSource ) ;
8
+ } ) ;
9
+ audioElem . addEventListener ( "ended" , function ( ) {
10
+ var audioSource = audioElem . getAttribute ( "src" ) ;
8
11
{ { INTERFACE_EXPOSED_NAME } } . onAudioCompleted ( audioSource ) ;
9
12
} ) ;
10
13
} ) ;
You can’t perform that action at this time.
0 commit comments