top of page

Forum Posts

matheus.mvl
May 26, 2018
In Coding with Velo
Hi, Recently Chrome's autoplay policy changed. Now the Wix Html Component (read all iframes) won't play any audio unless the user actually clicks it. This completely shut off the possibility to play with audio using a Wix Component + Wix Html Component (ie.: play audio when user clicks a button, play audio when page loads). Now the iframe must receive permission to do it in the form of an allow="autoplay" in the html code when it's created. I know that the Wix Html Component is basically an <iframe> sandbox but we have no access to its html code. I have no idea on how to make it work now. Can anyone help please ?
1
4
486
matheus.mvl
May 19, 2018
In Coding with Velo
Hi, Some time ago I was trying to figure out how to play an audio file from a URL using the Html Component. Turns out I found out and it was quite easy. This is the post with the solution https://www.wix.com/code/home/forum/questions-answers/playing-audio-dynamically-solved Since then I have made more complex things with the audios for the website. The problem is that now out of the blue it's just not working anymore. So I've found out that it's an issue with Chrome policy on Autoplay. Basically autoplay is now allowed only if: User has interacted with the domain (click, tap, etc.). On desktop, the user's Media Engagement Index threshold has been crossed, meaning the user has previously play video with sound. On mobile, the user has added the site to his or her home screen. source: https://developers.google.com/web/updates/2017/09/autoplay-policy-changes Another issue that makes no sense for me is that even when I click the Text that sends a message to the Html Component to play the audio it just won't play. It shows the following error on the developer console: ''DOMException: play() failed because the user didn't interact wit te document first.'' But a user clicking a Text on the page shoud fall under the first exception mentioned above for autoplay to be allowed. The audios play just fine on FireFox, but not on I.E. I'm not sure if it's because of the same policy that Chrome has now adopted. Can anyone please point me in the right direction on how to deal with this ? I'm sure many more people have been impacted by this change. Chrome is the most used browser out there so it's a big deal if your website doesn't work properly on it. Personally I have a language learning website and it's imperative that the audio autoplay when the user is learning or reviewing words and phrases. Any guidance is appreciated!
2
0
596
matheus.mvl
Apr 28, 2018
In Coding with Velo
Hi all, I am using a regular page connected to a database to display a text, an image and a sound dinamically. For reasons that are irrelevant to the question I am not using a Wix Dinamic Item Page. I have a Next button that when clicked updates the elements on the page. However the text is always updated first than the image because it loads faster. What could I do to make sure that all the elements are updated together ? (i.e. Update all the elements only when the slower one has been loaded). Any guidance is appreciated
0
1
51
matheus.mvl
Mar 01, 2018
In Coding with Velo
Hi, I have two datasets with the same number of items and I'm using a loop to compare two date fields. If both dates are equal or less than today I want to set a field value of the first dataset to false. It seems to be an issue with the setFieldValue or next() methods, like the loop is continuing before the save is completed or something... I tried many things but I just can't figure it out. Any guidance is appreciated! Here's my code: export function button1_click(event, $w) { let today = new Date(); today.setHours(0); today.setMinutes(0); today.setSeconds(0); const numberOfItems = $w("#dataset1").getTotalCount(); var item_A = $w("#dataset1").getCurrentItem(); var item_B = $w("#dataset2").getCurrentItem(); if((item_A.reviewDate <= today) && (item_B.reviewDate <= today)) { $w("#dataset1").setFieldValue("study", false); $w("#dataset1").save(); } for(var i = 0; i < (numberOfItems - 1); i++) { $w("#dataset1").next().then( (_item_A) => { $w("#dataset2").next().then( (_item_B) => { if((_item_A.reviewDate <= today) && (_item_B.reviewDate <= today)) { $w("#dataset1").setFieldValue("study", false); $w("#dataset1").save(); } } ); } ); } }
1
4
464
matheus.mvl
Feb 21, 2018
In Coding with Velo
Hello! I am trying to access a specific field of a dataset. I've searched a lot and all the examples that I've found use the whole array of objects. They never access a specific field of a specific object. For example: $w("#myDataset").getItems(3, 2) .then( (result) => { let items = result.items; let totalCount = result.totalCount; let offset = result.offset; } ) .catch( (err) => { let errMsg = err.message; let errCode = err.code; } ); I know that this code, taken from the Wix API page, gets 2 items, beggining at the index 3, and puts them in the "items" array, but let's say that there's a text field called "Name" for every item in my database. How could I access the "Name" field of the second item retrieved by this method that I just used above ? Any help or guidance is appreciated!
0
4
4k
matheus.mvl
Feb 19, 2018
In Coding with Velo
Hello! I have a dynamic page that I want to use to display an image, a text and an audio file from a database. I know that audio format is not yet supported in databases, so I was thinking that to solve this I could use a text field with the audio URL and play it when the user clicks a button. The problem is I don't know how or even if it's possible to play and audio from a URL with Wix Code. It would probably be something like this: var a = new Audio(url); a.play(); Any help is appreciated!
4
29
9k

matheus.mvl

More actions
bottom of page