If we round up, we may end up with a display slightly bigger than what
the window can have, thus adding scroll bars. When rounding down we
avoid this problems.
Signed-off-by: Jeremy White <jwhite@codeweavers.com>
In case the user didn't provide any password, we want to prompt him for
it. Try once and if we get an permission denied error, then ask the
password and retry to connect.
Signed-off-by: Jeremy White <jwhite@codeweavers.com>
The disconnect() function were not checking the existence of the file
transfer area element, leading to stop the disconnect() before its end.
Signed-off-by: Jeremy White <jwhite@codeweavers.com>
We don't want the users to rely on anything else than main.js. All the
helper functions from the other files are thus imported in main and
exported there too.
This way all the user needs to import is:
import * as SpiceHtml5 from './main.js';
Signed-off-by: Jeremy White <jwhite@codeweavers.com>
When forcing the background of the input fields, this makes them
unreadable for dark themed browsers.
Signed-off-by: Jeremy White <jwhite@codeweavers.com>
spice-html5 does not support multiple display channels, and will only
use the first one offered by spice-server, and ignore the others. This
can cause issues when using a VM with a configured but unused
org.spice-space.stream.0 spice port as this will create a 'fake' display
channel which is offered by spice-server before the usual qxl display
channel.
This commit favours the display channel with id 0 rather than picking
the first one.
Signed-off-by: Christophe Fergeau <cfergeau@redhat.com>
Acked-by: Frediano Ziglio <fziglio@redhat.com>
log_draw() is used to debug drawing commands by dumping drawing
information to the JS console. This commit adds dumping of missing data
for uncompressed bitmaps. The 'stride' parameter is important, as
spice-html5 currently does not deal properly with such bitmaps.
Signed-off-by: Christophe Fergeau <cfergeau@redhat.com>
Acked-by: Jeremy White <jwhite@codeweavers.com>
Otherwise, we end up discarding stream data messages, and our decode
can become corrupted, notably on Chrome.
This way, we should not lose any messages while we are waiting for
source buffer creation.
Browsers now reliably autoplay, and issuing play prematurely
can generate an error in both Firefox and Chrome.
Hence we can simply remove this call and audio seems to work fine.
Around version 45, Firefox started being very particular about the
time stamps put into the Opus stream. The time stamps from the Spice server are
somewhat irregular. They mostly arrive every 10 ms, but sometimes it is 11, or sometimes
with two time stamps the same in a row. The previous logic resulted in fuzzy and/or
distorted audio streams in Firefox in a row.
Thus, we end up with an inelegant hack. Essentially, we force every packet to have
a 10ms time delta, unless there is an obvious gap in time stream, in which case we
will resync.
This replaces logic that mitigated only the duplicated time packets.
The long term solution would appear to be 'sequence' mode, but I cannot get
Firefox to use that mode (and MDN suggests that for codecs such as VP8 with time
stamps in line, that Firefox will not accept it).
We previously had a fairly crude 'gap detection', but browsers
are largely supporting the modern buffer semantics, and we can
now rely on them to detect under runs for us.
This improves audio in Chrome while playing large videos.
The playback code first tries to access this.source_buffer and then
would check whether it's defined.
This was causing unwanted exception to be thrown in the cockpit
spice-html5 plugin.
Previously, we sent them strictly upon receipt. However, receiving
is fast; by adding in some of the processing time (i.e. queueing and
so on), we encourage the adaptive rate control to slow down.