summaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2024-01-17optimized wire.js inbound function, reduce combine timesHEADmasterzengdongbao1-22/+33
If the frame data is large, it will be divided into multiple packets. In the current processing mode, each packet will be merged with the old packet into a new buffer, resulting in a large number of redundant operations. Optimization scheme: Use array cache packets, and finally use DataView.set to do a merge. After testing, 1080p picture data merging time can be reduced from 100ms to <5ms Signed-off-by: zengdongbao <zengdongbao@gmail.com>
2024-01-06fix keyboard mappings for international keyboard layoutsDavid Edler3-12/+166
Key presses by a client with an international keyboard layout will often fail. I.e. the key AltGr creates an error message "No mapping for key 255". This key is important to produce the @ symbol i.e. on German language keyboard. The currently used e.keyCode differs by browser vendor and is ambiguous for some keys. This change relies instead on the event.code, which is stable for most common keys and more complete. I keep the old implementation to rely on e.keyCode as a fallback if the e.code is not available or the mapping for it is missing. See merge request spice/spice-html5!14 Signed-off-by: David Edler <david.edler@canonical.com> Acked-by: Frediano Ziglio <freddy77@gmail.com>
2020-09-04addition of ctrl-alt-delete functionality on side navigation, with ↵Jonathan Race2-0/+4
associated js eventlistener
2020-09-04Style updates to include layout structure, side navigation, hidden menu, ↵Jonathan Race3-102/+196
consolidation of formatting, button effects, and color shift
2020-07-02Added needed import of function arraybuffer_to_strOliver Gutierrez1-1/+1
Acked-by: Frediano Ziglio <fziglio@redhat.com>
2020-04-09Make an attempt to follow the rules on auto play videos.Jeremy White1-0/+5
Browsers have stopped allowing auto play videos. The documented solution is to mute your video. This patch mutes our videos and also attempts to start playing if the auto play does not fire. Acked-by: Frediano Ziglio <fziglio@redhat.com>
2020-04-07Allow pointer events to go through our videos.Jeremy White1-1/+1
If a video covers up a substantial portion of the screen, you can no longer interact with it. This change allows pointer events to flow through to our canvas. Acked-by: Frediano Ziglio <fziglio@redhat.com>
2020-04-07Make the audio and video uids different.Jeremy White1-1/+1
This does not appear to matter, but let's just be safe. Signed-off-by: Jeremy White <jwhite@codeweavers.com> Acked-by: Frediano Ziglio <fziglio@redhat.com>
2020-04-07Review the webm video track header and remove the fixmes.Jeremy White1-8/+20
This involved a review of the Firefox parsing code along with the official specifcation, and setting these fields to the specified default values. Signed-off-by: Jeremy White <jwhite@codeweavers.com> Acked-by: Frediano Ziglio <fziglio@redhat.com>
2020-01-13Bug fix: non square cursors were drawn improperly.Jeremy White1-1/+1
2019-12-31Check if streams array exists in handle_draw_jpeg_onloadJoel Purra1-1/+1
- It seems `SpiceDisplayConn` does not always have the array `this.o.sc.streams` set. - It also seems (stream?) images can be loaded before `streams` is set. - Without `streams`, or the specific stream matching `this.o.id`, `this.o.sc.streams[this.o.id].frames_loading` cannot be accessed. - The check for the specific stream woth `this.o.id` is already in place, this patch adds a check for `this.o.sc.streams` in `handle_draw_jpeg_onload`. - There might be a better place to ensure that `this.o.sc.streams` is initialized; this quick fix saved my bacon today though. Might be related to, and perhaps fix: - https://bugs.freedesktop.org/show_bug.cgi?id=94776 - https://bugzilla.redhat.com/show_bug.cgi?id=1323144 Signed-off-by: Joel Purra <mig@joelpurra.se>
2019-08-23Merge branch 'fix-ctrl-alt-delete' into 'master'Jeremy White1-1/+1
Add the sc object to sendCtrlAltDel because it is otherwise undefined and issues a JS error See merge request spice/spice-html5!2
2019-08-20Add the sc object to sendCtrlAltDel because it is otherwise undefined and ↵Paul Hodges IV1-1/+1
issues a JS error
2019-08-06Fix double string termination in HTML pagespice-html5-0.2.2Frediano Ziglio1-1/+1
Signed-off-by: Frediano Ziglio <fziglio@redhat.com> Acked-by: Uri Lublin <uril@redhat.com>
2019-08-06Adjust the presentation of two byte scan codes.Jeremy White1-21/+17
The previous implementation worked strictly due to a bug which would luckily generate roughly the right scan codes, although we would send more codes than required. For example, the old implementation would send 0xdf48e0 for 'up key down' and '0xdfc8e0' for 'up key up'. The prepended 0xdf is incorrect; the correct values should be 0x48e0 and 0xc8e0. Essentially, it stored the bytes in reverse order and had a bug while flipping them. This code stores them in the order we transmit them which simplifies the code. Signed-off-by: Jeremy White <jwhite@codeweavers.com> Acked-by: Frediano Ziglio <fziglio@redhat.com>
2019-08-06Update the documentation and organization of the scancodes.Jeremy White1-44/+57
The common scan codes were disjointed and logically belong together. Signed-off-by: Jeremy White <jwhite@codeweavers.com> Acked-by: Frediano Ziglio <fziglio@redhat.com>
2019-08-06Support the keypad minus key in Chrome.Jeremy White1-1/+1
The keypad minus key at 109 is common between at least Chrome and Firefox. Signed-off-by: Jeremy White <jwhite@codeweavers.com> Acked-by: Frediano Ziglio <fziglio@redhat.com>
2019-08-06Use a named constant from atKeynames.js for the PrintScreen/SysRq key.Jeremy White2-2/+2
Correct a typo from the upstream atKeynames.js at the same time. Signed-off-by: Jeremy White <jwhite@codeweavers.com> Acked-by: Frediano Ziglio <fziglio@redhat.com>
2019-02-15More reliable mouse position reportingspice-html5-0.2.1Cédric Bosdonnat1-10/+8
Depending on the structure of the page, the computed mouse position was not correct. Typically the case happend when there is no offset between the canvas and the view area, but an offset on the view area. The MouseEvent.offsetX and offsetY functions are now widely enough spread to use them and avoid complex computations.
2019-02-14Hide the message console by default.spice-html5-0.2.0Jeremy White2-1/+3
2019-02-14Fix the console toggle in the new ES6 environment.Jeremy White1-3/+6
Signed-off-by: Jeremy White <jwhite@codeweavers.com>
2019-02-14Generate package.json from the Makefile.Jeremy White3-10/+23
Signed-off-by: Jeremy White <jwhite@codeweavers.com>
2019-02-14resize_helper: round sizes downCédric Bosdonnat1-4/+4
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>
2019-02-14resize_helper, no message box caseCédric Bosdonnat1-9/+12
The resize_handler need to check for the existence of the message box before computing it's size. Signed-off-by: Jeremy White <jwhite@codeweavers.com>
2019-02-14Document onsuccess callbackCédric Bosdonnat1-0/+2
Signed-off-by: Jeremy White <jwhite@codeweavers.com>
2019-02-14Prompt password in spice_auto.htmlCédric Bosdonnat1-4/+10
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>
2019-02-14Fix disconnect() codeCédric Bosdonnat2-2/+6
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>
2019-02-14Move sources into their own folderCédric Bosdonnat40-3/+3
To add some more order to the folder, move the JS files into their own src folder. Signed-off-by: Jeremy White <jwhite@codeweavers.com>
2019-02-14Prepare publishing on npmjsCédric Bosdonnat1-0/+21
Add package.json needed to publish on npmjs. Signed-off-by: Jeremy White <jwhite@codeweavers.com>
2019-02-14Expose all needed pieces in main.jsCédric Bosdonnat3-22/+25
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>
2019-02-14Remove duplicated enumsCédric Bosdonnat1-7/+0
Signed-off-by: Jeremy White <jwhite@codeweavers.com>
2019-02-14Introduce ES6 modulesCédric Bosdonnat39-1016/+58950
Avoid cluttering the global namespace. Use ES6 modules in order to to this. Signed-off-by: Jeremy White <jwhite@codeweavers.com>
2019-02-14Convert sha1.js line endings to Unix.Jeremy White1-346/+346
Signed-off-by: Jeremy White <jwhite@codeweavers.com>
2019-02-14CSS: don't force the background color or inputsCédric Bosdonnat1-1/+0
When forcing the background of the input fields, this makes them unreadable for dark themed browsers. Signed-off-by: Jeremy White <jwhite@codeweavers.com>
2018-07-19display: Only use display channel with id 0Christophe Fergeau1-3/+4
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>
2018-07-18display: Dump bitmap metadata in log_draw()Christophe Fergeau1-0/+6
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>
2017-06-22Add checkbox to toggle debug consoleTomáš Bohdálek2-2/+32
This allows show or hide debug console under spice screen.
2017-06-02Always show debug consoleTomáš Bohdálek1-4/+4
Make sure to show both screen and console.
2017-03-07Handle non topdown bitmapsPavel Grunt1-7/+13
2017-03-07Handling non-topdown lz_rgbVincent Desprez2-3/+16
Signed-off-by: Vincent Desprez <vincent.desprez@apwise.com>
2017-03-07When offered multiple heads, generate a warning, rather than failing in ↵Jeremy White1-1/+6
subtle ways.
2017-01-20Only drop an mjpeg frame if we are not currently processing one.Jeremy White1-2/+12
2017-01-20Disable the onload function when clearing the image source.Jeremy White1-0/+1
This fixes a bug introduced by my commit 42134d3e, which would lead to an infinite recursion of onload statements.
2017-01-20Detect video underrun and advance the current time.Jeremy White1-0/+8
This helps us avoid stalled video streams.
2017-01-20Add more stream information in high debug situations at an updateend event.Jeremy White1-0/+4
2017-01-20Catch and note updateend messages after video destruction.Jeremy White1-0/+6
2017-01-10Condense the playback queue before adding to the Media Buffer.Jeremy White1-1/+23
This helps Firefox in situations where the incoming traffic is preventing the audio element from processing data quickly enough.
2016-12-15Include the codec type in the stream creation message.Jeremy White1-1/+1
2016-12-15Move the queue length debug up to stream level 2.Jeremy White1-1/+1
It's a fair amount of noise, and not useful at level 1.
2016-12-15Display stream creation and destruction at debug level 1.Jeremy White1-2/+2
They are low frequency, useful messages and should be seen more readily.