{"action":"created","issue":{"url":"https://api.github.com/repos/sampotts/plyr/issues/1201","repository_url":"https://api.github.com/repos/sampotts/plyr","labels_url":"https://api.github.com/repos/sampotts/plyr/issues/1201/labels{/name}","comments_url":"https://api.github.com/repos/sampotts/plyr/issues/1201/comments","events_url":"https://api.github.com/repos/sampotts/plyr/issues/1201/events","html_url":"https://github.com/sampotts/plyr/issues/1201","id":366907517,"node_id":"MDU6SXNzdWUzNjY5MDc1MTc=","number":1201,"title":"HTML5 Audio preload=\"none\" isn't beeing respected when using API source setter","user":{"login":"adassumpcao","id":30472354,"node_id":"MDQ6VXNlcjMwNDcyMzU0","avatar_url":"https://avatars0.githubusercontent.com/u/30472354?v=4","gravatar_id":"","url":"https://api.github.com/users/adassumpcao","html_url":"https://github.com/adassumpcao","followers_url":"https://api.github.com/users/adassumpcao/followers","following_url":"https://api.github.com/users/adassumpcao/following{/other_user}","gists_url":"https://api.github.com/users/adassumpcao/gists{/gist_id}","starred_url":"https://api.github.com/users/adassumpcao/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/adassumpcao/subscriptions","organizations_url":"https://api.github.com/users/adassumpcao/orgs","repos_url":"https://api.github.com/users/adassumpcao/repos","events_url":"https://api.github.com/users/adassumpcao/events{/privacy}","received_events_url":"https://api.github.com/users/adassumpcao/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-10-04T18:07:56Z","updated_at":"2018-10-05T12:16:27Z","closed_at":null,"author_association":"NONE","body":"Hi,\r\n\r\nIt seems the HTML5 audio preload=\"none\" isn't beeing respected when using API to change source. I have detected 2 issues, explained bellow:\r\n\r\n**Scenario:**\r\n\r\nI have a scenario where I am loading several audio players in the same page. The sources locations are being loaded initially (on page load) directly in the HTML and then by calling Plyr's constructor with the associated DOM selectors. This works perfectly fine and preload attribute in the audio tag is being respected (as a consequence no network requests are being made and timeDuration displayed is 00:00, like expected).\r\n\r\n**Issue 1 (main issue)**\r\n\r\nNote: I've originally  discovered issue 1 while debugging for issue 2.\r\n\r\nAt some point I have a function that calls API play.source setter for each individual player to set new sources on-the-fly. At this point preload isn't respected anymore and metadata is being preloaded (bulk network calls are made to preload metadata and timeDuration is now being populated instead of 00:00).\r\n\r\nIn this scenario,I think preload should continue to be respected. By looking at the source code I noticed that the Plyr object is being destroyed and then \"re-setup\"\". If possible, preload attribute should be inherited from previous setup or alternatively, at least, by an option settable through the source setter input object.\r\n\r\n\r\n**Issue 2**\r\n\r\nConditions: \r\n\r\n- This seems to be only an issue with Firefox, while Chrome is 100% working during my tests.\r\n- I have tested 2 different instances of firefox in different OSs, and the issue is still present. \r\n\r\nNote: If this issue gets confirmed I can open a separate issue if necessary. \r\n\r\n\r\nThis is a bizarre issue I must say. It seems while loading several players on the fly and metadata preloading is happening, Firefox randomly?!? stalls some of the preload tasks. I've experienced this issue while changing simultaneously the source for roughly ~10-15 up to 50 player instances. So far I haven't experienced this issue with lower count of player instances.\r\n\r\nThe following symptoms happen:\r\n\r\n- As an effect of this issue, not all all players show the timeDuration. Sometimes timeDuration stops showing from a specific player up to the end of the player list. Other times. some random players don't show the timeDuration (with more prominence for the players at the end of the list). Although, the first case is the most common. It seems somehow the preloading tasks are getting stuck. \r\n\r\n- The browser is not making the network requests associated to those players with issues (symptom of preloading tasks getting stuck).\r\n\r\n- The players which don't show timeDuration can't play at all when you click on them (don't seem to respond to events). Hitting play just falls in an eternal loading wait... (waiting for datapreload?!).\r\n \r\n- And actually, hitting play in one of these players affects all other healthy players also, which all then stop working/responding any click (at this point Plyr handlers all get stuck?). \r\n\r\n- Another weird thing happens. If i hit play on the last healthy player of the list (before the first player with timeDuration 00:00 appears), then this seems to somehow trigger/unblock the event associated with the next player and preload proceeds (timeDuration gets refreshed and plays correctly). If you then proceed to click play on the previously bad player, then the next bad player gets refreshed... and so on. But if I hit play directly in any bad player, everything will freeze (even the healthy players). \r\n\r\nIt's a bit random, i tried to debug but it's not easy to trace all the events and where they get stuck.\r\n\r\nI'll keep digging more to see if I can understand better what's happening under the hood with issue 2. \r\n\r\nIn the meanwhile any help is most welcome.\r\n\r\nThanks,\r\n\r\nArtur\r\n \r\n\r\n"},"comment":{"url":"https://api.github.com/repos/sampotts/plyr/issues/comments/427345230","html_url":"https://github.com/sampotts/plyr/issues/1201#issuecomment-427345230","issue_url":"https://api.github.com/repos/sampotts/plyr/issues/1201","id":427345230,"node_id":"MDEyOklzc3VlQ29tbWVudDQyNzM0NTIzMA==","user":{"login":"adassumpcao","id":30472354,"node_id":"MDQ6VXNlcjMwNDcyMzU0","avatar_url":"https://avatars0.githubusercontent.com/u/30472354?v=4","gravatar_id":"","url":"https://api.github.com/users/adassumpcao","html_url":"https://github.com/adassumpcao","followers_url":"https://api.github.com/users/adassumpcao/followers","following_url":"https://api.github.com/users/adassumpcao/following{/other_user}","gists_url":"https://api.github.com/users/adassumpcao/gists{/gist_id}","starred_url":"https://api.github.com/users/adassumpcao/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/adassumpcao/subscriptions","organizations_url":"https://api.github.com/users/adassumpcao/orgs","repos_url":"https://api.github.com/users/adassumpcao/repos","events_url":"https://api.github.com/users/adassumpcao/events{/privacy}","received_events_url":"https://api.github.com/users/adassumpcao/received_events","type":"User","site_admin":false},"created_at":"2018-10-05T12:16:27Z","updated_at":"2018-10-05T12:16:27Z","author_association":"NONE","body":"Regarding issue 2, after some investigation I think I've found the culprit. I am now opening a new separate issue. "}}
{"actor":{"display_login":"adassumpcao"}}