{"action":"created","issue":{"url":"https://api.github.com/repos/chadpaulson/react-cassette-player/issues/4","labels_url":"https://api.github.com/repos/chadpaulson/react-cassette-player/issues/4/labels{/name}","comments_url":"https://api.github.com/repos/chadpaulson/react-cassette-player/issues/4/comments","events_url":"https://api.github.com/repos/chadpaulson/react-cassette-player/issues/4/events","html_url":"https://github.com/chadpaulson/react-cassette-player/issues/4","id":56181584,"number":4,"title":"Audio element doesn't play new audio when src updated via props","user":{"login":"mjw56","id":161528,"avatar_url":"https://avatars.githubusercontent.com/u/161528?v=3","gravatar_id":"","url":"https://api.github.com/users/mjw56","html_url":"https://github.com/mjw56","followers_url":"https://api.github.com/users/mjw56/followers","following_url":"https://api.github.com/users/mjw56/following{/other_user}","gists_url":"https://api.github.com/users/mjw56/gists{/gist_id}","starred_url":"https://api.github.com/users/mjw56/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mjw56/subscriptions","organizations_url":"https://api.github.com/users/mjw56/orgs","repos_url":"https://api.github.com/users/mjw56/repos","events_url":"https://api.github.com/users/mjw56/events{/privacy}","received_events_url":"https://api.github.com/users/mjw56/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-02-01T22:38:48Z","updated_at":"2015-03-20T00:28:04Z","closed_at":"2015-03-19T01:01:38Z","body":"Hey,\r\n\r\nThanks for this project, this is really cool! I noticed this component would not play new audio when new props were passed to src attribute. I was able to fix it by adding:\r\n\r\n```javascript\r\n  componentDidUpdate: function(prevProps, prevState) {\r\n    if(prevProps.src !== this.props.src) {\r\n      var node = this.refs.player.getDOMNode();\r\n      node.src = this.props.src;\r\n      node.play();\r\n    }\r\n  },\r\n```\r\nIt's kind of hard to test for this. If you inspect element after passing new props to src the new props are there but the new audio does not play. It wasn't until I manually grabbed the node via getDOMNode, placed src on it and called .play() did it play new audio right away.\r\n\r\nLemme know... I'll gladly send a PR if you'd like to add this."},"comment":{"url":"https://api.github.com/repos/chadpaulson/react-cassette-player/issues/comments/83823690","html_url":"https://github.com/chadpaulson/react-cassette-player/issues/4#issuecomment-83823690","issue_url":"https://api.github.com/repos/chadpaulson/react-cassette-player/issues/4","id":83823690,"user":{"login":"mjw56","id":161528,"avatar_url":"https://avatars.githubusercontent.com/u/161528?v=3","gravatar_id":"","url":"https://api.github.com/users/mjw56","html_url":"https://github.com/mjw56","followers_url":"https://api.github.com/users/mjw56/followers","following_url":"https://api.github.com/users/mjw56/following{/other_user}","gists_url":"https://api.github.com/users/mjw56/gists{/gist_id}","starred_url":"https://api.github.com/users/mjw56/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mjw56/subscriptions","organizations_url":"https://api.github.com/users/mjw56/orgs","repos_url":"https://api.github.com/users/mjw56/repos","events_url":"https://api.github.com/users/mjw56/events{/privacy}","received_events_url":"https://api.github.com/users/mjw56/received_events","type":"User","site_admin":false},"created_at":"2015-03-20T00:28:04Z","updated_at":"2015-03-20T00:28:04Z","body":"Hey Chad,\r\n\r\nSorry for the late response. I just tested your latest version and it is indeed working when passing in new props. I appreciate you taking the time to fix. Nice job again on this sweet component! :musical_note: :musical_note: :musical_note: \r\n\r\nCheers,\r\nMike"}}