Friday, June 16, 2023
2 changes · master
New functionality added to Odoo
Website editors can now upload MP4 videos directly in the media dialog instead of relying on third-party video platforms. Uploaded videos are stored on the local server, can be reused from a gallery, and support common playback options such as autoplay, controls, and looping.
Original PR description
Previously, users could only upload videos to third party websites and embed them through the media dialog to add them to the website. It is now possible for users to upload videos as ir.attachments…
Previously, users could only upload videos to third party websites and embed them through the media dialog to add them to the website. It is now possible for users to upload videos as ir.attachments in the video media dialog and embed them on the website with the native HTML5 video player. The video is then stored on the local server and not on a 3rd party website, and served directly from the same server. This change makes it easier for users to use the website platform without having to register to third party websites for video services. The uploaded files are limited to the supported mp4 codecs and a file size of 128 Mb. Once uploaded, the video can be configured the same way an embedded video can with options for autoplay, hiding controls and looping. The user can access a gallery of already uploaded videos similar to the image dialog, with thumbnails depicting the videos as well as a preview being rendered when selecting a video or when modifying its options. Videos can either be embedded or selected in the video media dialog, which is emphasized by hiding the irrelevant elements to the current selection. In order to upload larger files, it is necessary to also add a client_max_body_size of at least 130M to match the internal size limit for video uploads (NGINX configuration). ### Technical notes: - Background videos use the same option for autoplay and mute, since browsers allow autoplay seemlessly only when the video is muted (mute + defaultMute) - Uploaded videos are added using the native HTML5 video tag in the iframe's srcdoc. This way, any styling applied to regular embedded videos is also applied to the uploaded videos consistently. - Videos are limited to natively supported mp4 formats (4 differents binary signatures) and an error is raised if the file doesn't have one of the signatures. - Videos are limited to 128 MB with a server-side size check raising and error if the file is bigger. - Thumbnails have a max height of 120px, preserve aspect ratio, and have styling applied to center them in the attachment containers. - Uploading and serving videos is done from 'web/content/' to apply processing, encoding, size and format checks server-side. - New route for asynchronously updating video thumbnails - New placeholder video for when an attachment was deleted or removed from the database (/web/static/video/placeholder.mp4) - With the new changes, web_editor's ir_attachment renames image_src, image_width and image_height to src, width and height respectively, to accomodate for both videos and images. - Special handling is used for fetchAttachments in order to accommodate the case where a previously selected attachment exists, but it is not in the first loaded attachments. An RPC is made to fetch that specific attachment and insert it into the displayed attachments. task-2618497 Ent PR: odoo/enterprise#22286 Upgrade PR: odoo/upgrade#3065
Users can now type an exact font size directly in the editor toolbar while still seeing the recommended size list. This makes content formatting more flexible and also includes small toolbar fixes to keep editing controls working smoothly and avoid sidebar overflow.
Original PR description
With this commit, when a user clicks on the font size number in the editor's toolbar, two things happen: 1. Same as before: the list of recommended sizes opens. 2. The current font size is selected, and the user can type any value they want. They need to confirm with "Enter" to use a custom value. task-3167041 --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr