#1
by
nicolas
I've been observing the log "socket.send() raised exception." very often lately while using otree devserver to test my app. I have shortened the code below. It also happens with the attached code, which is very rudimentary. Unfortunately, I don't know if it's caused by the server or the client? Does it perhaps happen when the video tag is affected and, for example, the browser is moved or resized?
----------------------------------------
HTML:
{{ extends 'global/Page.html' }} {{ block title }}Movies{{ endblock }} {{block
content }}
<video id="video-player" width="800" oncontextmenu="return false;">
<source src="{{ static 'movies/movie01.mp4' }}" type="video/mp4" />
Your browser does not support the video tag.
</video>
<input type="button" id="ready-button" value="Ready" onclick="handleClick()"/>
<script>
function handleClick() {
liveSend("hello from client");
}
</script>
{{ endblock }}
----------------------------------------
Python:
def live_page_interaction(player: Player, data):
print("received a message:", data)
class MoviePlayer(Page):
form_model = "player"
live_method = "live_page_interaction"
page_sequence = [MoviePlayer]