Commit Graph
4 Commits
Author SHA1 Message Date
Tom De Caluwéandqsm-odoo ca60af9dad [FIX] web_editor, website: allow autoplay of youtube videos on mobile
The autoplay option for youtube videos in a .media_iframe_video snippet
does not currently work on mobile devices. This happens because the
autoplay param in the url is only considered for desktop devices.

Mobile autoplay can be forced by using the youtube js api, in the same
way as it is already done for background videos. Therefore, the common
code is extracted into a mixin, extended by both widgets.

opw-2607308

closes odoo/odoo#89439

X-original-commit: 83972aa28957414d53c69bb41ce36646891a829e
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
Co-authored-by: qsm-odoo <qsm@odoo.com>
2022-04-25 10:27:48 +02:00
Kamen Zhekov b88e7aba8a [IMP] web_editor: improve video embed regexes (youku, dailymotion)
The regex patterns for dailymotion and youku were too permissive and
not specific enough for the way they were intended to be used.

The new regexes should correctly isolate the video ID from the URL
string and cover all embedding needs for the two providers.
There are also new test cases for specific embed URL variations.

For the initiating discussion and PR, see following link:
https://github.com/odoo/odoo/pull/44537#discussion_r753250276

task-2696033

closes odoo/odoo#82369

Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2022-04-07 14:20:26 +02:00
Fabien Pinckaers 6b87526048 [IMP] Speed Imp: remove unnecessary base64 encode & decode
Avoid to base64 encode, then decode to process assets and images for a ~25% speed improvement.
Change image processing tool to work on images, rather than base64 encoded strings.

Performance is ~25% faster on assets & images:

  /web/assets/...frontend.min.css:    13ms to 7ms,  base64 enc/dec: 2 -> 0
  /web/image/XML_ID:                  10ms to 8ms,  base64 enc/dec: 3 -> 0
  /web/image/res.users/2/avatar_128:  40ms to 20ms, base64 enc/dec: 6 -> 2

closes odoo/odoo#82851

Related: odoo/enterprise#23537
Signed-off-by: Fabien Pinckaers <fp@odoo.com>
2022-01-22 11:51:42 +00:00
2dd772dab8 [IMP] website, *: improve video providers handling
*: web_editor, website_sale

This commit adds the abibility to get an image thumbnail based on the
video provider URL and to avoid duplicating the regexes. It also
improves those URL regexes.

All the regexes are kept in a python tools file and are called in JS
using an RPC.

task-2154812

closes odoo/odoo#44537

Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
Co-authored-by: ras-odoo <ras@odoo.com>
Co-authored-by: bbh-odoo <bbh@odoo.com>
2021-11-19 22:32:39 +00:00