Skip to Content
Odoo Meniu
  • Autentificare
  • Try it free
  • Aplicații
    Finanțe
    • Contabilitate
    • Facturare
    • Cheltuieli
    • Spreadsheet (BI)
    • Documente
    • Semn
    Vânzări
    • CRM
    • Vânzări
    • POS Shop
    • POS Restaurant
    • Abonamente
    • Închiriere
    Site-uri web
    • Constructor de site-uri
    • eCommerce
    • Blog
    • Forum
    • Live Chat
    • eLearning
    Lanț Aprovizionare
    • Inventar
    • Producție
    • PLM
    • Achiziție
    • Maintenance
    • Calitate
    Resurse Umane
    • Angajați
    • Recrutare
    • Time Off
    • Evaluări
    • Referințe
    • Flotă
    Marketing
    • Social Marketing
    • Marketing prin email
    • SMS Marketing
    • Evenimente
    • Automatizare marketing
    • Sondaje
    Servicii
    • Proiect
    • Foi de pontaj
    • Servicii de teren
    • Centru de asistență
    • Planificare
    • Programări
    Productivitate
    • Discuss
    • Aprobări
    • IoT
    • VoIP
    • Knowledge
    • WhatsApp
    Aplicații Terțe Odoo Studio Platforma Odoo Cloud
  • Industrii
    Retail
    • Book Store
    • Magazin de îmbrăcăminte
    • Magazin de Mobilă
    • Magazin alimentar
    • Magazin de materiale de construcții
    • Magazin de jucării
    Food & Hospitality
    • Bar and Pub
    • Restaurant
    • Fast Food
    • Guest House
    • Distribuitor de băuturi
    • Hotel
    Proprietate imobiliara
    • Real Estate Agency
    • Firmă de Arhitectură
    • Construcție
    • Estate Managament
    • Grădinărit
    • Asociația Proprietarilor de Proprietăți
    Consultanta
    • Firma de Contabilitate
    • Partener Odoo
    • Agenție de marketing
    • Law firm
    • Atragere de talente
    • Audit & Certification
    Producție
    • Textil
    • Metal
    • Mobilier
    • Mâncare
    • Brewery
    • Cadouri corporate
    Health & Fitness
    • Club Sportiv
    • Magazin de ochelari
    • Centru de Fitness
    • Wellness Practitioners
    • Farmacie
    • Salon de coafură
    Trades
    • Handyman
    • IT Hardware and Support
    • Asigurare socială de stat
    • Cizmar
    • Servicii de curățenie
    • HVAC Services
    Altele
    • Organizație nonprofit
    • Agenție de Mediu
    • Închiriere panouri publicitare
    • Fotografie
    • Închiriere biciclete
    • Asigurare socială
    Browse all Industries
  • Comunitate
    Învăță
    • Tutorials
    • Documentație
    • Certificări
    • Instruire
    • Blog
    • Podcast
    Empower Education
    • Program Educațional
    • Scale Up! Business Game
    • Visit Odoo
    Obține Software-ul
    • Descărcare
    • Compară Edițiile
    • Lansări
    Colaborați
    • Github
    • Forum
    • Evenimente
    • Translations
    • Devino Partener
    • Services for Partners
    • Înregistrează-ți Firma de Contabilitate
    Obține Servicii
    • Găsește un Partener
    • Găsiți un contabil
    • Meet an advisor
    • Servicii de Implementare
    • Referințe ale clienților
    • Suport
    • Actualizări
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Obține un demo
  • Prețuri
  • Ajutor

Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:

  • CRM
  • e-Commerce
  • Contabilitate
  • Inventar
  • PoS
  • Proiect
  • MRP
All apps
Trebuie să fiți înregistrat pentru a interacționa cu comunitatea.
All Posts Oameni Insigne
Etichete (View all)
odoo accounting v14 pos v15
Despre acest forum
Trebuie să fiți înregistrat pentru a interacționa cu comunitatea.
All Posts Oameni Insigne
Etichete (View all)
odoo accounting v14 pos v15
Despre acest forum
Suport

Support byte-range requests on Odoo Web server (werkzeug)?

Abonare

Primiți o notificare când există activitate la acestă postare

Această întrebare a fost marcată
werkzeughtml5webserver
4 Răspunsuri
8670 Vizualizări
Imagine profil
Evans Bernier

Hello,

I placed a video on a Odoo website homepage using HTML5 tags. The video size is arround 11 Mb. I can not play this video on iOS system only. I found the cause of the problem. For iOS, my web server need to support "byte-range requests" as see here : \http://stackoverflow.com/a/4762072

I put my video under an Apache Web server and I am able to play the video on iOS by using the URL to this video on Apache server. But, I would like to stock the video file on my Odoo custom module, then reach the video from my Odoo URL.

Is there a way to support "byte-range requests" on Odoo Web server?


Thanks

0
Imagine profil
Abandonează
Imagine profil
Ximple Things Pte. Ltd.
Cel mai bun răspuns

In case anyone requires any help or advice on this issue. I managed to write a custom controller to stream mp4 video file to all devices including iOS mobile devices. See the code snippet below for streaming mp4 video file from odoo.  Hope the code works for you, but streaming mp4 file from odoo is not recommended because of odoo is not meant for streaming media and it will affect odoo's performance if the video request gets too much.

Thus, my recommended solution is to setup apache2 to serve the video media. The load speed of the video is drastically faster than loading from odoo. 

Hope this helps.

@http.route(['/mainvideo'], type='http', auth="public", website=True)
    def website_mainvideo(self, **post):
        cr, uid, context, registry = request.cr, request.uid, request.context, request.registry
        mainvideo = ""
        with open("static/src/videos/homepage.mp4", 'rb') as mp4_file:
            mainvideo = mp4_file.read()
        headers = [('Content-Type', 'video/mp4'),('Accept-Ranges', 'bytes')]
        
        status = 200
        if request.httprequest.range:
            contentrange = request.httprequest.range.make_content_range(len(mainvideo))
            if contentrange.stop < len(mainvideo):
                status = 206
                headers.append(('Content-Range','bytes %s-%s/%s' % (str(contentrange.start), str(contentrange.stop), str(len(mainvideo)))))
            elif contentrange.stop > len(mainvideo):
                status = 416
                mainvideo = ""
                
        if status != 416:
            mainvideo = mainvideo[contentrange.start:contentrange.stop]
            headers.append(('Content-Length', len(mainvideo)))
        response = Response(mainvideo, status=status, headers=headers, content_type="video/mp4")
        return response

0
Imagine profil
Abandonează
Imagine profil
Christian Mahlich
Cel mai bun răspuns

Hi,

I just raised the same issue to Odoo. Unfrotunately the issue was not solved but just disabled to show the play button on iOS.

https://github.com/odoo/odoo/commit/5e3b471f4a67553d6f7525595b15dc3d7b4efb3f


This was the reply:

The explanation about your issue is:
HTTP servers hosting media files for iOS must support byte-range requests, which iOS
uses to perform random access in media playback. (Byte-range support is also
known as content-range or partial-range support.) But Odoo server doesn't support partial 
requests with accept-ranges.

So the fix was to unable the button play on IOS.
But we will try to improve it in master.
Thanks for your feedback.


Has anyone found a solution yet because I need this as well!

Do you maybe have some further information on the nginx "work around"
I cannot follow this and understand what actually is to do.

Thanks in advance!

0
Imagine profil
Abandonează
Imagine profil
Phillip
Cel mai bun răspuns

I do not think there is any way to support byte-range requests in Odoo server without modifications. You may be able to implement some of werkzeug's byte-range responses by designing a custom controller to handle your media. I have seen reference to byte-range handling in headers in werkzeug's docs however I have not seen a plug and play example for handling byte-range requests.


It took me quite a while to even determine why media was not loading on safari. I do not own an apple computer so using the developer tools is much more difficult. 


The simplest work around is on the same server you are hosting Odoo on you can define nginx or apache webserver to serve requests for Odoo using a reverse proxy. 


Define a specific set of paths that are handled exclusively by apache or nginx and host your media there. I have tested this and it works.


Another option is to use a CDN to host your media. And simply use a CDN that supports byte-range requests. Then just change the url on your Odoo server's html to point at your CDN. This approach has the additional benefit of lowering the number of requests on your server and frees up your bandwidth for other purposes.


Here is an example virtualhost config for apache. 


<VirtualHost *:80>
        ServerAdmin admin@example.com
        ServerName byterangetest.com
        DocumentRoot /var/www/media/
        ProxyPass /your_addon/static/src/vids !
        ProxyPass / http://byterangetest.com:8069/
        ProxyPassReverse / http://byterangetest:8069/
        CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>
# vim: syntax=apache ts=4 sw=4 sts=4 sr noet
        ErrorLog ${APACHE_LOG_DIR}/error.log
0
Imagine profil
Abandonează
Imagine profil
Evans Bernier
Autor Cel mai bun răspuns

Any news? It is an important case to be able to show video on Apple devices...

Thanks

0
Imagine profil
Abandonează
Enjoying the discussion? Don't just read, join in!

Create an account today to enjoy exclusive features and engage with our awesome community!

Înscrie-te
Related Posts Răspunsuri Vizualizări Activitate
custom design
html5
Imagine profil
Imagine profil
1
mai 25
4686
werkzeug Response throwing error on v9
werkzeug
Imagine profil
0
dec. 16
4703
How can I specify a werkzeug version on my openerp configuration?
werkzeug
Imagine profil
0
mar. 15
4849
How do I specify the path of an MP3 file for it to be accessible on website?
audio webserver
Imagine profil
0
ian. 22
3458
Odoo 11 - Missing <!DOCTYPE html> in some page of the website, e.g. shop
html5 odoo11.0
Imagine profil
1
mai 20
5009
Comunitate
  • Tutorials
  • Documentație
  • Forum
Open Source
  • Descărcare
  • Github
  • Runbot
  • Translations
Servicii
  • Hosting Odoo.sh
  • Suport
  • Actualizare
  • Custom Developments
  • Educație
  • Găsiți un contabil
  • Găsește un Partener
  • Devino Partener
Despre Noi
  • Compania noastră
  • Active de marcă
  • Contactați-ne
  • Locuri de muncă
  • Evenimente
  • Podcast
  • Blog
  • Clienți
  • Aspecte juridice • Confidențialitate
  • Securitate
الْعَرَبيّة Català 简体中文 繁體中文 (台灣) Čeština Dansk Nederlands English Suomi Français Deutsch हिंदी Bahasa Indonesia Italiano 日本語 한국어 (KR) Lietuvių kalba Język polski Português (BR) română русский язык Slovenský jazyk slovenščina Español (América Latina) Español ภาษาไทย Türkçe українська Tiếng Việt

Odoo este o suită de aplicații de afaceri open source care acoperă toate nevoile companiei dvs.: CRM, comerț electronic, contabilitate, inventar, punct de vânzare, management de proiect etc.

Propunerea de valoare unică a Odoo este să fie în același timp foarte ușor de utilizat și complet integrat.

Website made with

Odoo Experience on YouTube

1. Use the live chat to ask your questions.
2. The operator answers within a few minutes.

Live support on Youtube
Watch now