Youtube player unmute function does not work inside an iframe - youtube-iframe-api

I have the youtube player autoplays MUTED inside an iframe and have an unmute button and I am calling unMute() on pressing the button. However I get this error:
Unmuting failed and the element was paused instead because the user didn't interact with the document before
Here the link to the page:
https://video.inpwrd.net/college-prep-dont-go-it-alone/48ebe783-bcc4-4b96-9ba5-aff3db5f13df
Outside iframe it works. This is definitely a bug because I am sticking to autoplay muted policy. This is the stack trace:
Unmuting failed and the element was paused instead because the user didn't interact with the document before
g.h.xk # base.js:6951
jya # base.js:4586
yQ # base.js:4585
Fna # base.js:3091
g.h.unMute # base.js:6718
a.F.(anonymous function) # base.js:3082
g.h.handleExternalCall # base.js:6698
a.C.(anonymous function) # base.js:3086
(anonymous) # www-embed-player.js:526
k.la # www-embed-player.js:609
k.La # www-embed-player.js:598
ii.B # www-embed-player.js:594

Related

Wordpress DIVI theme - can't add image (Uncaught TypeError: Cannot read property 'replace' of undefined)

I'm having hard time understanding what happened. Everything worked flawlessly.
When i try to add or replace image using DIVI visual builder, nothing is happening on click.
This is what i found in console:
Uncaught TypeError: Cannot read property 'replace' of undefined
at Function.v.template (underscore.min.js?ver=1.8.3:1)
at i.template (wp-util.min.js?ver=5.3.2:1)
at i.render (wp-backbone.min.js?ver=5.3.2:1)
at i.attach (media-views.min.js?ver=5.3.2:1)
at i.open (media-views.min.js?ver=5.3.2:1)
at i.<computed> [as open] (media-views.min.js?ver=5.3.2:1)
at t._onClick (bundle.modals.c075dc5f.js:18)
at Object.Gg (react-dom.production.min.js?ver=16.7.0:155)
at Fg (react-dom.production.min.js?ver=16.7.0:13)
at Ig (react-dom.production.min.js?ver=16.7.0:13)
v.template # underscore.min.js?ver=1.8.3:1
(anonymous) # wp-util.min.js?ver=5.3.2:1
render # wp-backbone.min.js?ver=5.3.2:1
attach # media-views.min.js?ver=5.3.2:1
open # media-views.min.js?ver=5.3.2:1
i.<computed> # media-views.min.js?ver=5.3.2:1
_onClick # bundle.modals.c075dc5f.js:18
Gg # react-dom.production.min.js?ver=16.7.0:155
Fg # react-dom.production.min.js?ver=16.7.0:13
Ig # react-dom.production.min.js?ver=16.7.0:13
be # react-dom.production.min.js?ver=16.7.0:15
Jg # react-dom.production.min.js?ver=16.7.0:156
Ic # react-dom.production.min.js?ver=16.7.0:15
Kc # react-dom.production.min.js?ver=16.7.0:16
hh # react-dom.production.min.js?ver=16.7.0:39
mg # react-dom.production.min.js?ver=16.7.0:149
se # react-dom.production.min.js?ver=16.7.0:23
Yb # react-dom.production.min.js?ver=16.7.0:40
og # react-dom.production.min.js?ver=16.7.0:150
Te # react-dom.production.min.js?ver=16.7.0:40
Things i try and did not helped me:
clearing cache
changing browsers
disabled divi's js and css minify feature
rollbacking divi to older version
changing php version (7.3 actual version)
Running on newest version of wordpress v5.3.2.
I'm running out of options. Any suggestion will help.
Thanks!
Just as a side note, when I had this issue it was eventually tracked down to some improperly formatted javascript code in the global footer.

How to fix List Box returning null value using UIA wrapper

I want to access text values from a List BOX (pywinauto uia wrapper)that is nested inside LIST view inside the application used.
code snippet:
#upper window
up_window.ListView.wait('visible').Select('Enforcement').click_input(double=True)
time.sleep(5)
#after this enforcement window opens and i need to select the third tab which is performed below and its working fine.
enfwin = guilib.get_window('Enforcement', backend='uia')
# guilib is user defined library which will retun the window handle
if enf_win.TabControl.get_selected_tab() != 2:
log.debug("Clicking on 'Targets' tab in Enforcement window")
enf_win.TabControl`enter code here`.wait('enabled', timeout=60).select(2)
time.sleep(30)
list_rows = enf_win.ListBox.wait('ready', timeout=60).texts()
dcs_win.ListView.wait('visible').Select('Enforcement').click_input(double=True)
time.sleep(5)
enf_win = guilib.get_window('Enforcement', backend='uia')
if enf_win.TabControl.get_selected_tab() != 2:
log.debug("Clicking on 'Targets' tab in Enforcement window")
enf_win.TabControl.wait('enabled', timeout=60).select(2)
time.sleep(30)
list_rows = enf_win.ListBox.wait('ready', timeout=60).texts()
The problem here is, when I am calling this function two times from script, 1 st run its fetching the list_rows whereas in second run its returning blank. It seems like it needed some time in between. But increasing time is not helping.
Please suggest if any modification I need to do to fetch list box value each time.

Determine time frame between mousePress and mouseMove for drag event in RxPy

I am trying to achieve a drag and drop feature. The layout of my UI looks similar to below:
--- --- ---
| 1 | 2 | |
--- --- 5 |
| 3 | 4 | |
--- --- ---
Boxes 1, 2, 3 and 4 are images and will have a white border surrounding it when selected by a user. This selection action is executed with a left press.
Box 5 displays some basic information of the selected image.
The images in Boxes 1, 2, 3 and 4 can be dragged and dropped into Box 5. On a successful dropped, a thumbnail of the dropped image will also be displayed in Box 5.
I have no issues executing a drag and drop action which is achieved using RxPy. My code for the drag and drop looks as follows:
drag_start = self.viewer.events \
.filter(lambda ev: ev.type == MouseEventType.LeftPress)
drag_move = self.viewer.events \
.filter(lambda ev: ev.type == MouseEventType.MouseMove)
drag = drag_start \
.flat_map(lambda ev: \
drag_move \
.first()
)
drag.subscribe(lambda ev: self.start_drag())
# and yes, i do not have a takeUntil mouse release event in my stream. this is done intentionally.
i have a thumbnail implemented in start_drag that follows wherever the cursor moves. i have left this part of the code out since it is not the highlight of the problem i am facing.
The problem i have is this. If I were to select an image, and no matter how much later I do a mouse move, start_drag will be fired and creates the thumbnail. if the mouse move event occurs after a certain time frame since the last left press, it should not be viewed as a drag event and not fire start_drag. Instead, an 'instant' left press + mouse move event will be seen as a drag event
what should be added to my event stream such that i will be able to determine the duration between the left press and mouse move events? subsequently, if this duration is more than the time frame, i will ignore and not fire start_drag. or is there a better solution to this problem?
delay, debounce basically either pushes or delays the stream and i cannot achieve what i want with those operators.

Introduce loading time delay before getting the URL in r

I need to web-scrape through a number of pages. Given that there are many pages, I first write down the html files in my external HD and then process them.
The problem is that when I try to get the URL I always download the same page, because the website waits half a second to display the new page.
The code is as follows
library(RCurl)
library(stringr)
library(XML)
for(i in 1:numberPages){
# Generate the unique URL for each page
url <- str_c('https://www..../#{"page":"', i, '"}')
# Download the page
bill.result <- try(getURL(url))
while(class(bill.result)=="try-error"){ # if class()==error, retry to get the url after 1 sec
cat("Page irresponsive - trying again")
Sys.sleep(1)
bill.result <- try(getURL(url))
}
# Write the page to local hard drive
result <- try(write(bill.result, str_c(new_folder, "/page", i, ".html")))
while(class(result)=="try-error"){ # if class()==error, retry to write after 2 min
cat("I will sleep if network is down")
Sys.sleep(120)
result <- try(write(bill.result, str_c(new_folder, "/page", i, ".html")))
}
# Print progress of download
cat(i, "\n")
}
I have searched and havenĀ“t found an option that would wait, say, 1 second before getting the URL. Without this wait time, I always download the same page, no matter where in the loop I am. I know this because when I change the url address in my browser the page is the same for 1 second, and then it changes to the page I wanted in the first place.

Updating gWidgets elements in R

I'm having trouble updating graphical elements in R and I can't figure it out. I'd appreciate a little push.
I'm trying to make a simple GUI which is prepopulated with some options, but when a button is pressed the database is queried (the query is modified by the GUI), and the result needs to change what's available in the gcomboboxes and gtables. I'm frankly amazed at how simple it is to create such an excellent environment in R.
I don't believe I can modify the body of gcomboboxes or gtables once they're on screen (if I can, that's probably my preferred solution). I also don't believe I can destroy individual elements of a glayout, only the entire glayout. But how do I get it back in the right order?
# Small example for GUI element creation and destruction
if(!require("RGtk2")) {library("RGtk2")}
if(!require("digest")) {library("digest")}
if(!require("cairoDevice")) {library("cairoDevice")}
if(!require("gWidgets")) {library("gWidgets")}
if(!require("gWidgetsRGtk2")) {library("gWidgetsRGtk2")}
nw<-gwindow("Test",toolkit=guiToolkit("RGtk2"))
g<-ggroup(horizontal=FALSE,cont=nw)
t1<-glayout(container=g) # Header
t2<-glayout(container=g) # Dynamic middle
t3<-glayout(container=g) # Footer
t1[1,1]<-gcombobox(c("foo","bar"))
t1[1,2]<-gbutton("Update")
t2[1,1]<-gframe("",container=t2)
t2[2,1]<-gcombobox(c("violin","metal"))
t2[3,1]<-gtable(c("YoYoMa","Metallica"))
t3[1,1]<-glabel("Filler text",container=t3)
delete(g,t2) # Unable to delete t2[2,1] and t2[3,1]
t2<-glayout(container=g)
#t2[2,1]<-gcombobox(c("violin","metal","pop")) ### Nope...
#t2[3,1]<-gtable(c("YoYoMa","Metallica","UB40"))
#add(t2,gcombobox(c("violin","metal","pop"))) ### Nope...
#add(t2,gtable(c("YoYoMa","Metallica","UB40")))
All my added elements go below my footer text. How do I straighten it out so they go between the header and footer?
If I don't delete the glayout, it looks like I can modify the contents of the gcombobox, but the UI doesn't really reflect it. I can see new text when I click the arrow, but the selection no longer appears to change.
...
t2[2,1]<-gcombobox(c("text to remove","violin","metal"))
t2[3,1]<-gtable(c("YoYoMa","Metallica"))
t3[1,1]<-glabel("Filler text",container=t3)
t2[2,1]<-gcombobox(c("violin","metal","pop")) # "text to remove" remains selected regardless of user input
t2[3,1]<-gtable(c("YoYoMa","Metallica","UB40"))
It was a little frustrating, but this is working well for me. I'll leave this solution here in case anybody else has trouble.
# Small example for GUI element creation and destruction
if(!require("RGtk2")) {library("RGtk2")}
if(!require("digest")) {library("digest")}
if(!require("cairoDevice")) {library("cairoDevice")}
if(!require("gWidgets")) {library("gWidgets")}
if(!require("gWidgetsRGtk2")) {library("gWidgetsRGtk2")}
nw<-gwindow("Test",toolkit=guiToolkit("RGtk2"))
g<-ggroup(horizontal=FALSE,cont=nw)
t1<-glayout(container=g) # Header
t2<-glayout(container=g) # Dynamic middle
t3<-glayout(container=g) # Footer
t1[1,1]<-gcombobox(c("foo","bar"))
t1[1,2]<-gbutton("Update")
t2[1,1]<-gframe("",container=t2)
t2[2,1]<-gcombobox(c("text to remove","violin","metal"))
t2[3,1]<-gtable(c("YoYoMa","Metallica"))
t2[3,1]<-gtable(BandList)
t3[1,1]<-glabel("Filler text",container=t3)
t2[2,1][]<-c("violin","metal","pop")
svalue(t2[2,1])<-"pop" #otherwise it's confused about defaults
t2[3,1][]<-c("YoYoMa","Metallica","UB40")
I found a way to edit the contents already on screen without needing to delete the screen elements.
# Small example for GUI element creation and destruction
if(!require("RGtk2")) {library("RGtk2")}
if(!require("digest")) {library("digest")}
if(!require("cairoDevice")) {library("cairoDevice")}
if(!require("gWidgets")) {library("gWidgets")}
if(!require("gWidgetsRGtk2")) {library("gWidgetsRGtk2")}
nw<-gwindow("Test",toolkit=guiToolkit("RGtk2"))
g<-ggroup(horizontal=FALSE,cont=nw)
t1<-glayout(container=g) # Header
t2<-glayout(container=g) # Dynamic middle
t3<-glayout(container=g) # Footer
t1[1,1]<-gcombobox(c("foo","bar"))
t1[1,2]<-gbutton("Update")
t2[1,1]<-gframe("",container=t2)
t2[2,1]<-gcombobox(c("text to remove","violin","metal"))
t2[3,1]<-gtable(c("YoYoMa","Metallica"))
t2[3,1]<-gtable(BandList)
t3[1,1]<-glabel("Filler text",container=t3)
t2[2,1][]<-c("violin","metal","pop")
svalue(t2[2,1])<-"pop" #otherwise it's confused about defaults
t2[3,1][]<-c("YoYoMa","Metallica","UB40")

Resources