@@ -15,6 +15,32 @@ import classNames from 'classnames';
1515
1616export class MeetingItem extends Component {
1717
18+ componentDidMount ( ) {
19+ if ( this . props . meetSoundPlay && this . props . meetSoundPlay . play )
20+ this . playSound ( ) ;
21+ }
22+
23+ componentWillReceiveProps ( nextProps ) {
24+ if ( nextProps . meetSoundPlay ) {
25+ if ( nextProps . meetSoundPlay . play )
26+ this . playSound ( ) ;
27+ else
28+ this . closeSound ( ) ;
29+ }
30+ }
31+
32+ playSound ( ) {
33+ var meetSound = this . refs [ 'meetSound' ] ;
34+ meetSound . autoplay = true ;
35+ meetSound . loop = true ;
36+ } ;
37+
38+ closeSound ( ) {
39+ var meetSound = this . refs [ 'meetSound' ] ;
40+ meetSound . pause ( ) ;
41+ meetSound . currentTime = 0 ;
42+ }
43+
1844 render ( ) {
1945 const statusColorType = this . props . statusColorType ;
2046 const AVATAR_LIMIT = this . props . avatarLimit ;
@@ -31,6 +57,12 @@ export class MeetingItem extends Component {
3157 className = { classNames ( 'rce-container-mtitem' , this . props . className ) }
3258 onClick = { this . props . onClick }
3359 onContextMenu = { this . props . onContextMenu } >
60+
61+ < audio
62+ ref = "meetSound"
63+ src = { this . props . meetSoundPlay && this . props . meetSoundPlay . src }
64+ autoPlay />
65+
3466 < div className = "rce-mtitem" >
3567 < div className = "rce-mtitem-top" >
3668 < div className = "rce-mtitem-subject" >
@@ -121,6 +153,7 @@ MeetingItem.defaultProps = {
121153 lazyLoadingImage : undefined ,
122154 avatarLimit : 5 ,
123155 avatars : [ ] ,
156+ meetSoundPlay : null ,
124157 onAvatarError : ( ) => void ( 0 ) ,
125158 onMeetingClick : ( ) => void ( 0 ) ,
126159 onShareClick : ( ) => void ( 0 ) ,
0 commit comments