Recherche avancée

Médias (91)

Autres articles (98)

  • MediaSPIP 0.1 Beta version

    25 avril 2011, par

    MediaSPIP 0.1 beta is the first version of MediaSPIP proclaimed as "usable".
    The zip file provided here only contains the sources of MediaSPIP in its standalone version.
    To get a working installation, you must manually install all-software dependencies on the server.
    If you want to use this archive for an installation in "farm mode", you will also need to proceed to other manual (...)

  • Les vidéos

    21 avril 2011, par

    Comme les documents de type "audio", Mediaspip affiche dans la mesure du possible les vidéos grâce à la balise html5 .
    Un des inconvénients de cette balise est qu’elle n’est pas reconnue correctement par certains navigateurs (Internet Explorer pour ne pas le nommer) et que chaque navigateur ne gère en natif que certains formats de vidéos.
    Son avantage principal quant à lui est de bénéficier de la prise en charge native de vidéos dans les navigateur et donc de se passer de l’utilisation de Flash et (...)

  • Personnaliser en ajoutant son logo, sa bannière ou son image de fond

    5 septembre 2013, par

    Certains thèmes prennent en compte trois éléments de personnalisation : l’ajout d’un logo ; l’ajout d’une bannière l’ajout d’une image de fond ;

Sur d’autres sites (6013)

  • RTSP to HLS via FFMPEG, latency issues

    28 juin 2024, par Pabl0

    The following are all the steps that I took to render a RTSP stream in my web app :

    


    How to display RTSP stream in browser using HLS

    


    Situation and Problem
You have an RTSP stream that you want to display in a browser using HLS (HTTP Live Streaming). However, when you try to play the RTSP stream in the browser using hls.js, you encounter the error "Unsupported HEVC in M2TS found." This error indicates that the HLS stream uses the HEVC (H.265) codec, which is not widely supported by many browsers and HLS players, including hls.js.

    


    The most reliable solution is to transcode the stream from H.265 to H.264 using FFmpeg, which is more broadly supported. Here's how to transcode the stream :

    


    Step 1 : Transcode the Stream Using FFmpeg

    


    Run the following FFmpeg command to transcode the RTSP stream from H.265 to H.264 and generate the HLS segments :

    


    ffmpeg -i rtsp://192.168.144.25:8554/main.264 -c:v libx264 -c:a aac -strict -2 -hls_time 10 -hls_list_size 0 -f hls C:\path\to\output\index.m3u8


    


    c:v libx264 sets the video codec to H.264.

    


    c:a aac sets the audio codec to AAC.

    


    hls_time 10 sets the duration of each segment to 10 seconds.

    


    hls_list_size 0 tells FFmpeg to include all segments in the playlist.

    


    f hls specifies the output format as HLS.

    


    C :\path\to\output\ is the directory where the HLS files will be saved. Ensure that C :\path\to\output\ is the directory where you want to save the HLS files.

    


    Step 2 : Verify the HLS Files

    


    After running the FFmpeg command, verify that the following files are generated in the output directory :

    


    index.m3u8 (HLS playlist file)

    


    Multiple .ts segment files (e.g., index0.ts, index1.ts, etc.)

    


    Step 3 : Serve the HLS Files with an HTTP Server

    


    Navigate to the directory containing the HLS files and start the HTTP server :

    


    cd C :\path\to\output
python -m http.server 8000
Step 4 : Update and Test the HTML File
Ensure that hls_test.html file is in the same directory as the HLS files and update it as needed :

    


    hls_test.html :

    


    &#xA;&#xA;    &#xA;        &#xA;        &#xA;        &#xA;    &#xA;    &#xA;        <h1>HLS Stream Test</h1>&#xA;        <button>Play Stream</button>&#xA;        <video controls="controls" style="width: 100%; height: auto;"></video>&#xA;        <code class="echappe-js">&lt;script src=&quot;https://cdn.jsdelivr.net/npm/hls.js@latest&quot;&gt;&lt;/script&gt;&#xA;        &lt;script&gt;&amp;#xA;            document&amp;#xA;                .getElementById(&amp;#x27;playButton&amp;#x27;)&amp;#xA;                .addEventListener(&amp;#x27;click&amp;#x27;, () =&gt; {&amp;#xA;                    const video = document.getElementById(&amp;#x27;video&amp;#x27;);&amp;#xA;                    if (Hls.isSupported()) {&amp;#xA;                        const hls = new Hls();&amp;#xA;                        hls.loadSource(&amp;#x27;http://localhost:8000/index.m3u8&amp;#x27;);&amp;#xA;                        hls.attachMedia(video);&amp;#xA;                        hls.on(Hls.Events.MANIFEST_PARSED, function () {&amp;#xA;                            video.play().catch((error) =&gt; {&amp;#xA;                                console.error(&amp;#xA;                                    &amp;#x27;Error attempting to play:&amp;#x27;,&amp;#xA;                                    error,&amp;#xA;                                );&amp;#xA;                            });&amp;#xA;                        });&amp;#xA;                        hls.on(Hls.Events.ERROR, function (event, data) {&amp;#xA;                            console.error(&amp;#x27;HLS Error:&amp;#x27;, data);&amp;#xA;                        });&amp;#xA;                    } else if (&amp;#xA;                        video.canPlayType(&amp;#x27;application/vnd.apple.mpegurl&amp;#x27;)&amp;#xA;                    ) {&amp;#xA;                        video.src = &amp;#x27;http://localhost:8000/index.m3u8&amp;#x27;;&amp;#xA;                        video.addEventListener(&amp;#x27;canplay&amp;#x27;, function () {&amp;#xA;                            video.play().catch((error) =&gt; {&amp;#xA;                                console.error(&amp;#xA;                                    &amp;#x27;Error attempting to play:&amp;#x27;,&amp;#xA;                                    error,&amp;#xA;                                );&amp;#xA;                            });&amp;#xA;                        });&amp;#xA;                    } else {&amp;#xA;                        console.error(&amp;#x27;HLS not supported in this browser.&amp;#x27;);&amp;#xA;                    }&amp;#xA;                });&amp;#xA;        &lt;/script&gt;&#xA;    &#xA;&#xA;

    &#xA;

    Step 5 : Open the HTML File in Your Browser

    &#xA;

    Open your browser and navigate to :

    &#xA;

    http://localhost:8000/hls_test.html&#xA;

    &#xA;

    Click the "Play Stream" button to start playing the HLS stream. If everything is set up correctly, you should see the video playing in the browser.

    &#xA;

    Conclusion

    &#xA;

    By transcoding the RTSP stream from H.265 to H.264 and serving it as an HLS stream, you can display the video in a browser using hls.js. This approach ensures broader compatibility with browsers and HLS players, allowing you to stream video content seamlessly.

    &#xA;

    PART 2 : Add this method to the react app

    &#xA;

    We are assuming that the ffmpeg command is running in the background and generating the HLS stream. Now, we will create a React component that plays the HLS stream in the browser using the video.js library.

    &#xA;

    If not, please refer to the previous steps to generate the HLS stream using FFmpeg. (steps 1-3 of the previous section)

    &#xA;

    Step 1 : Create the Camera Component

    &#xA;

    import { useRef } from &#x27;react&#x27;;&#xA;import videojs from &#x27;video.js&#x27;;&#xA;import &#x27;video.js/dist/video-js.css&#x27;;&#xA;&#xA;const Camera = ({ streamUrl }) => {&#xA;    const videoRef = useRef(null);&#xA;    const playerRef = useRef(null);&#xA;&#xA;    const handlePlayClick = () => {&#xA;        const videoElement = videoRef.current;&#xA;        if (videoElement) {&#xA;            playerRef.current = videojs(videoElement, {&#xA;                controls: true,&#xA;                autoplay: false,&#xA;                preload: &#x27;auto&#x27;,&#xA;                sources: [&#xA;                    {&#xA;                        src: streamUrl,&#xA;                        type: &#x27;application/x-mpegURL&#x27;,&#xA;                    },&#xA;                ],&#xA;            });&#xA;&#xA;            playerRef.current.on(&#x27;error&#x27;, () => {&#xA;                const error = playerRef.current.error();&#xA;                console.error(&#x27;VideoJS Error:&#x27;, error);&#xA;            });&#xA;&#xA;            playerRef.current.play().catch((error) => {&#xA;                console.error(&#x27;Error attempting to play:&#x27;, error);&#xA;            });&#xA;        }&#xA;    };&#xA;&#xA;    return (&#xA;        &#xA;            <button>Play Stream</button>&#xA;            &#xA;        &#xA;    );&#xA;};&#xA;&#xA;export default Camera;&#xA;

    &#xA;

    Note : This component uses the video.js library to play the HLS stream. Make sure to install video.js using npm or yarn :

    &#xA;

    npm install video.js

    &#xA;

    Step 2 : Use the Camera Component in Your App

    &#xA;

    Now, you can use the Camera component in your React app to display the HLS stream. Here's an example of how to use the Camera component :

    &#xA;

    <camera streamurl="http://localhost:8000/index.m3u8"></camera>

    &#xA;

    Note : see we are pointing to the HLS stream URL generated by FFmpeg in the previous steps.

    &#xA;

    Step 3 : Create the Cors Proxy Server and place it where the HLS files are being stored.

    &#xA;

    from http.server import HTTPServer, SimpleHTTPRequestHandler&#xA;import socketserver&#xA;import os&#xA;&#xA;class CORSRequestHandler(SimpleHTTPRequestHandler):&#xA;    def end_headers(self):&#xA;        if self.path.endswith(&#x27;.m3u8&#x27;):&#xA;            self.send_header(&#x27;Content-Type&#x27;, &#x27;application/vnd.apple.mpegurl&#x27;)&#xA;        elif self.path.endswith(&#x27;.ts&#x27;):&#xA;            self.send_header(&#x27;Content-Type&#x27;, &#x27;video/MP2T&#x27;)&#xA;        super().end_headers()&#xA;&#xA;if __name__ == &#x27;__main__&#x27;:&#xA;    port = 8000&#xA;    handler = CORSRequestHandler&#xA;    web_dir = r&#x27;C:\Video_cam_usv&#x27;&#xA;    os.chdir(web_dir)&#xA;    httpd = socketserver.TCPServer((&#x27;&#x27;, port), handler)&#xA;    print(f"Serving HTTP on port {port}")&#xA;    httpd.serve_forever()&#xA;

    &#xA;

    Note : Change the web_dir to the directory where the HLS files are stored.

    &#xA;

    Also, note that the server is sending the correct MIME types for .m3u8 and .ts files. For example :

    &#xA;

    .m3u8 should be application/vnd.apple.mpegurl or application/x-mpegURL.&#xA;.ts should be video/MP2T.&#xA;

    &#xA;

    Step 4 : Start the CORS Proxy Server

    &#xA;

    Open a terminal, navigate to the directory where the CORS proxy server script is located (same as the HLS files are being saved), and run the following command :

    &#xA;

    python cors_proxy_server.py&#xA;

    &#xA;

    This will start the CORS proxy server on port 8000 and serve the HLS files with the correct MIME types.

    &#xA;

    Step 5 : Start the React App&#xA;Start your React app using the following command :

    &#xA;

    npm run dev

    &#xA;

    I have tried everything above (it´s my own doc to keep with the steps Ive taken so far) and I get the stream to render on my web app but the latency is very high, at least of 5-10 secs, how can i make it be real time or close to that ?

    &#xA;

  • What Is Data Misuse & How to Prevent It ? (With Examples)

    13 mai 2024, par Erin

    Your data is everywhere. Every time you sign up for an email list, log in to Facebook or download a free app onto your smartphone, your data is being taken.

    This can scare customers and users who fear their data will be misused.

    While data can be a powerful asset for your business, it’s important you manage it well, or you could be in over your head.

    In this guide, we break down what data misuse is, what the different types are, some examples of major data misuse and how you can prevent it so you can grow your brand sustainably.

    What is data misuse ?

    Data is a good thing.

    It helps analysts and marketers understand their customers better so they can serve them relevant information, products and services to improve their lives.

    But it can quickly become a bad thing for both the customers and business owners when it’s mishandled and misused.

    What is data misuse?

    Data misuse is when a business uses data outside of the agreed-upon terms. When companies collect data, they need to legally communicate how that data is being used. 

    Who or what determines when data is being misused ?

    Several bodies :

    • User agreements
    • Data privacy laws
    • Corporate policies
    • Industry regulations

    There are certain laws and regulations around how you can collect and use data. Failure to comply with these guidelines and rules can result in several consequences, including legal action.

    Keep reading to discover the different types of data misuse and how to prevent it.

    3 types of data misuse

    There are a few different types of data misuse.

    If you fail to understand them, you could face penalties, legal trouble and a poor brand reputation.

    3 types of data misuse.

    1. Commingling

    When you collect data, you need to ensure you’re using it for the right purpose. Commingling is when an organisation collects data from a specific audience for a specific reason but then uses the data for another purpose.

    One example of commingling is if a company shares sensitive customer data with another company. In many cases, sister companies will share data even if the terms of the data collection didn’t include that clause.

    Another example is if someone collects data for academic purposes like research but then uses the data later on for marketing purposes to drive business growth in a for-profit company.

    In either case, the company went wrong by not being clear on what the data would be used for. You must communicate with your audience exactly how the data will be used.

    2. Personal benefit

    The second common way data is misused in the workplace is through “personal benefit.” This is when someone with access to data abuses it for their own gain.

    The most common example of personal benefit data muse is when an employee misuses internal data.

    While this may sound like each instance of data misuse is caused by malicious intent, that’s not always the case. Data misuse can still exist even if an employee didn’t have any harmful intent behind their actions. 

    One of the most common examples is when an employee mistakenly moves data from a company device to personal devices for easier access.

    3. Ambiguity

    As mentioned above, when discussing commingling, a company must only use data how they say they will use it when they collect it.

    A company can misuse data when they’re unclear on how the data is used. Ambiguity is when a company fails to disclose how user data is being collected and used.

    This means communicating poorly on how the data will be used can be wrong and lead to misuse.

    One of the most common ways this happens is when a company doesn’t know how to use the data, so they can’t give a specific reason. However, this is still considered misuse, as companies need to disclose exactly how they will use the data they collect from their customers.

    Laws on data misuse you need to follow

    Data misuse can lead to poor reputations and penalties from big tech companies. For example, if you step outside social media platforms’ guidelines, you could be suspended, banned or shadowbanned.

    But what’s even more important is certain types of data misuse could mean you’re breaking laws worldwide. Here are some laws on data misuse you need to follow to avoid legal trouble :

    General Data Protection Regulation (GDPR)

    The GDPR, or General Data Protection Regulation, is a law within the European Union (EU) that went into effect in 2018.

    The GDPR was implemented to set a standard and improve data protection in Europe. It was also established to increase accountability and transparency for data breaches within businesses and organisations.

    The purpose of the GDPR is to protect residents within the European Union.

    The penalties for breaking GDPR laws are fines up to 20 million Euros or 4% of global revenues (whatever the higher amount is).

    The GDPR doesn’t just affect companies in Europe. You can break the GDPR’s laws regardless of where your organisation is located worldwide. As long as your company collects, processes or uses the personal data of any EU resident, you’re subject to the GDPR’s rules.

    If you want to track user data to grow your business, you need to ensure you’re following international data laws. Tools like Matomo—the world’s leading privacy-friendly web analytics solution—can help you achieve GDPR compliance and maintain it.

    With Matomo, you can confidently enhance your website’s performance, knowing that you’re adhering to data protection laws. 

    Try Matomo for Free

    Get the web insights you need, without compromising data accuracy.

    No credit card required

    California Consumer Privacy Act (CCPA)

    The California Consumer Privacy Act (CCPA) is another important data law companies worldwide must follow.

    Like GDPR, the CCPA is a data privacy law established to protect residents of a certain region — in this case, residents of California in the United States.

    The CCPA was implemented in 2020, and businesses worldwide can be penalised for breaking the regulations. For example, if you’re found violating the CCPA, you could be fined $7,500 for each intentional violation.

    If you have unintentional violations, you could still be fined, but at a lesser fee of $2,500.

    The Gramm-Leach-Bliley Act (GLBA)

    If your business is located within the United States, then you’re subject to a federal law implemented in 1999 called The Gramm-Leach-Bliley Act (GLB Act or GLBA).

    The GLBA is also known as the Financial Modernization Act of 1999. Its purpose is to control the way American financial institutions handle consumer data. 

    In the GLBA, there are three sections :

    1. The Financial Privacy Rule : regulates the collection and disclosure of private financial data.
    2. Safeguards Rule : Financial institutions must establish security programs to protect financial data.
    3. Pretexting Provisions : Prohibits accessing private data using false pretences.

    The GLBA also requires financial institutions in the U.S. to give their customers written privacy policy communications that explain their data-sharing practices.

    4 examples of data misuse in real life

    If you want to see what data misuse looks like in real life, look no further.

    Big tech is central to some of the biggest data misuses and scandals.

    4 examples of data misuse in real life.

    Here are a few examples of data misuse in real life you should take note of to avoid a similar scenario :

    1. Facebook election interference

    One of history’s most famous examples of data misuse is the Facebook and Cambridge Analytica scandal in 2018.

    During the 2018 U.S. midterm elections, Cambridge Analytica, a political consulting firm, acquired personal data from Facebook users that was said to have been collected for academic research.

    Instead, Cambridge Analytica used data from roughly 87 million Facebook users. 

    This is a prime example of commingling.

    The result ? Cambridge Analytica was left bankrupt and dissolved, and Facebook was fined $5 billion by the Federal Trade Commission (FTC).

    2. Uber “God View” tracking

    Another big tech company, Uber, was caught misusing data a decade ago. 

    Why ?

    Uber implemented a new feature for its employees in 2014 called “God View.”

    The tool enabled Uber employees to track riders using their app. The problem was that they were watching them without the users’ permission. “God View” lets Uber spy on their riders to see their movements and locations.

    The FTC ended up slapping them with a major lawsuit, and as part of their settlement agreement, Uber agreed to have an outside firm audit their privacy practices between 2014 and 2034.

    Uber "God View."

    3. Twitter targeted ads overstep

    In 2019, Twitter was found guilty of allowing advertisers to access its users’ personal data to improve advertisement targeting.

    Advertisers were given access to user email addresses and phone numbers without explicit permission from the users. The result was that Twitter ad buyers could use this contact information to cross-reference with Twitter’s data to serve ads to them.

    Twitter stated that the data leak was an internal error. 

    4. Google location tracking

    In 2020, Google was found guilty of not explicitly disclosing how it’s using its users’ personal data, which is an example of ambiguity.

    The result ?

    The French data protection authority fined Google $57 million.

    8 ways to prevent data misuse in your company

    Now that you know the dangers of data misuse and its associated penalties, it’s time to understand how you can prevent it in your company.

    How to prevent data misuse in your company.

    Here are eight ways you can prevent data misuse :

    1. Track data with an ethical web analytics solution

    You can’t get by in today’s business world without tracking data. The question is whether you’re tracking it safely or not.

    If you want to ensure you aren’t getting into legal trouble with data misuse, then you need to use an ethical web analytics solution like Matomo.

    With it, you can track and improve your website performance while remaining GDPR-compliant and respecting user privacy. Unlike other web analytics solutions that monetise your data and auction it off to advertisers, with Matomo, you own your data.

    Try Matomo for Free

    Get the web insights you need, without compromising data accuracy.

    No credit card required

    2. Don’t share data with big tech

    As the data misuse examples above show, big tech companies often violate data privacy laws.

    And while most of these companies, like Google, appear to be convenient, they’re often inconvenient (and much worse), especially regarding data leaks, privacy breaches and the sale of your data to advertisers.

    Have you ever heard the phrase : “You are the product ?” When it comes to big tech, chances are if you’re getting it for free, you (and your data) are the products they’re selling.

    The best way to stop sharing data with big tech is to stop using platforms like Google. For more ideas on different Google product alternatives, check out this list of Google alternatives.

    3. Identity verification 

    Data misuse typically isn’t a company-wide ploy. Often, it’s the lack of security structure and systems within your company. 

    An important place to start is to ensure proper identity verification for anyone with access to your data.

    4. Access management

    After establishing identity verification, you should ensure you have proper access management set up. For example, you should only give specific access to specific roles in your company to prevent data misuse.

    5. Activity logs and monitoring

    One way to track data misuse or breaches is by setting up activity logs to ensure you can see who is accessing certain types of data and when they’re accessing it.

    You should ensure you have a team dedicated to continuously monitoring these logs to catch anything quickly.

    6. Behaviour alerts 

    While manually monitoring data is important, it’s also good to set up automatic alerts if there is unusual activity around your data centres. You should set up behaviour alerts and notifications in case threats or compromising events occur.

    7. Onboarding, training, education

    One way to ensure quality data management is to keep your employees up to speed on data security. You should ensure data security is a part of your employee onboarding. Also, you should have regular training and education to keep people informed on protecting company and customer data.

    8. Create data protocols and processes 

    To ensure long-term data security, you should establish data protocols and processes. 

    To protect your user data, set up rules and systems within your organisation that people can reference and follow continuously to prevent data misuse.

    Leverage data ethically with Matomo

    Data is everything in business.

    But it’s not something to be taken lightly. Mishandling user data can break customer trust, lead to penalties from organisations and even create legal trouble and massive fines.

    You should only use privacy-first tools to ensure you’re handling data responsibly.

    Matomo is a privacy-friendly web analytics tool that collects, stores and tracks data across your website without breaking privacy laws.

    With over 1 million websites using Matomo, you can track and improve website performance with :

    • Accurate data (no data sampling)
    • Privacy-friendly and compliant with privacy regulations like GDPR, CCPA and more
    • Advanced features like heatmaps, session recordings, A/B testing and more

    Try Matomo free for 21-days. No credit card required.

  • Streaming issues with HLS setup using Nginx and FFmpeg, and TS video files

    12 septembre 2024, par Jacob Anderson

    I've been working on setting up an HLS stream on my Raspberry Pi to broadcast video from a security camera that's physically connected to my Raspberry Pi through my web server, making it accessible via my website. The .ts video files and the .m3u8 playlist are correctly being served from /var/www/html/hls. However, when I attempt to load the stream on Safari (as well as other browsers), the video continuously appears to be loading without ever displaying any content.

    &#xA;

    Here are some details about my setup :

    &#xA;

      &#xA;
    • Camera : I am using an Arducam 1080p Day & Night Vision USB Camera which is available on /dev/video0.
    • &#xA;

    • Server Configuration : I haven't noticed any errors in the Safari console or on the server logs. When I access the .ts files directly from the browser, they only show a black screen but they do play.
    • &#xA;

    &#xA;

    Given the situation, I suspect there might be an issue with my FFmpeg command or possibly with my Nginx configuration.

    &#xA;

    Here is what I have :

    &#xA;

    ffmpeg stream service :&#xA;/etc/systemd/system/ffmpeg-stream.service

    &#xA;

    [Unit]&#xA;Description=FFmpeg RTMP Stream&#xA;After=network.target&#xA;&#xA;[Service]&#xA;ExecStart=/usr/local/bin/start_ffmpeg.sh&#xA;Restart=always&#xA;User=jacobanderson&#xA;Group=jacobanderson&#xA;StandardError=syslog&#xA;SyslogIdentifier=ffmpeg-stream&#xA;Environment=FFMPEG_LOGLEVEL=error&#xA;&#xA;[Install]&#xA;WantedBy=multi-user.target&#xA;

    &#xA;

    ffmpeg command :&#xA;/usr/local/bin/start_ffmpeg.sh

    &#xA;

    #!/bin/bash&#xA;&#xA;/usr/bin/ffmpeg -f v4l2 -input_format mjpeg -video_size 1280x720 -framerate 30 -i /dev/video0 -vcodec libx264 -preset veryfast -acodec aac -strict -2 -f flv rtmp://localhost/live/&#xA;

    &#xA;

    nginx.conf :&#xA;/etc/nginx/nginx.conf

    &#xA;

    user www-data;&#xA;worker_processes auto;&#xA;pid /run/nginx.pid;&#xA;error_log /var/log/nginx/error.log;&#xA;include /etc/nginx/modules-enabled/*.conf;&#xA;&#xA;events {&#xA;    worker_connections 768;&#xA;    # multi_accept on;&#xA;}&#xA;&#xA;rtmp {&#xA;    server {&#xA;        listen 1935;&#xA;        chunk_size 4096;&#xA;        #allow publish 127.0.0.1;&#xA;        #deny publish all;&#xA;&#xA;    application live {&#xA;        #allow 192.168.0.100;&#xA;        live on;&#xA;        hls on;&#xA;        hls_path /var/www/html/hls;&#xA;        hls_fragment 3;&#xA;        hls_nested on; &#xA;        #hls_fragment_naming stream;&#xA;        hls_playlist_length 120;&#xA;        hls_cleanup on;&#xA;        hls_continuous on;&#xA;        #deny play all;&#xA;    }&#xA;    }&#xA;}&#xA;&#xA;http {&#xA;    ##&#xA;    # Basic Settings&#xA;    ##&#xA;&#xA;    sendfile on;&#xA;    #sendfile off;&#xA;    tcp_nopush on;&#xA;    types_hash_max_size 2048;&#xA;    # server_tokens off;&#xA;&#xA;    # Additional for video&#xA;    directio 512;&#xA;&#xA;    # server_names_hash_bucket_size 64;&#xA;    # server_name_in_redirect off;&#xA;&#xA;    include /etc/nginx/mime.types;&#xA;    default_type application/octet-stream;&#xA;&#xA;    ##&#xA;    # SSL Settings&#xA;    ##&#xA;&#xA;    ssl_protocols TLSv1 TLSv1.1 TLSv1.2 TLSv1.3;&#xA;    #ssl_protocols TLSv1.2 TLSv1.3; # Use only secure protocols&#xA;    ssl_prefer_server_ciphers on;&#xA;    #ssl_ciphers "HIGH:!aNULL:!MD5";&#xA;&#xA;    ##&#xA;    # Logging Settings&#xA;    ##&#xA;&#xA;    access_log /var/log/nginx/access.log;&#xA;    error_log /var/log/nginx/error.log;&#xA;&#xA;    ##&#xA;    # Gzip Settings&#xA;    ##&#xA;&#xA;    #gzip on;&#xA;    gzip off;  # Ensure gzip is off for HLS&#xA;&#xA;    ##&#xA;    # Virtual Host Configs&#xA;    ##&#xA;&#xA;    include /etc/nginx/conf.d/*.conf;&#xA;    include /etc/nginx/sites-enabled/*;&#xA;}&#xA;

    &#xA;

    sites-available :&#xA;/etc/nginx/sites-available/myStream.mysite.com

    &#xA;

    server {&#xA;    listen 443 ssl;&#xA;    server_name myStream.mysite.com;&#xA;&#xA;    ssl_certificate /etc/letsencrypt/live/myStream.mysite.com/fullchain.pem; # managed by Certbot&#xA;    ssl_certificate_key /etc/letsencrypt/live/myStream.mysite.com/privkey.pem; # managed by Certbot&#xA;    include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot&#xA;    ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot&#xA;&#xA;    location / {&#xA;        root /var/www/html/hls;&#xA;        index index.html;&#xA;    }&#xA;&#xA;    location /hls {&#xA;        # Password protection&#xA;        auth_basic "Restricted Content";&#xA;        auth_basic_user_file /etc/nginx/.htpasswd;&#xA;&#xA;        # Disable cache&#xA;        add_header Cache-Control no-cache;&#xA;&#xA;        # CORS setup&#xA;        add_header &#x27;Access-Control-Allow-Origin&#x27; &#x27;*&#x27; always;&#xA;        add_header &#x27;Access-Control-Expose-Headers&#x27; &#x27;Content-Length&#x27;;&#xA;&#xA;        # Allow CORS preflight requests&#xA;        if ($request_method = &#x27;OPTIONS&#x27;) {&#xA;            add_header &#x27;Access-Control-Allow-Origin&#x27; &#x27;*&#x27;;&#xA;            add_header &#x27;Access-Control-Max-Age&#x27; 1728000;&#xA;            add_header &#x27;Content-Type&#x27; &#x27;text/plain charset=UTF-8&#x27;;&#xA;            add_header &#x27;Content-Length&#x27; 0;&#xA;            return 204;&#xA;        }&#xA;&#xA;        types {&#xA;            application/vnd.apple.mpegurl m3u8;&#xA;            video/mp2t ts;&#xA;        text/html html;&#xA;        text/css css;&#xA;        }&#xA;&#xA;    root /var/www/html;&#xA;    }&#xA;}&#xA;&#xA;server {&#xA;    listen 80;&#xA;    server_name myStream.mysite.com;&#xA;&#xA;    if ($host = myStream.mysite.com) {&#xA;        return 301 https://$host$request_uri;&#xA;    }&#xA;&#xA;    return 404; # managed by Certbot&#xA;}&#xA;

    &#xA;

    index.html :&#xA;/var/www/html/hls/index.html

    &#xA;

    &#xA;&#xA;&#xA;    &#xA;    &#xA;    &#xA;    &#xA;    <code class="echappe-js">&lt;script src='http://stackoverflow.com/feeds/tag/js/hls.min.js'&gt;&lt;/script&gt;&#xA;&#xA;&#xA;    &#xA;        &#xA;    &#xA;    &#xA;&#xA;    &lt;script src=&quot;https://vjs.zencdn.net/7.10.2/video.js&quot;&gt;&lt;/script&gt;&#xA;    &lt;script&gt;&amp;#xA;        if (Hls.isSupported()) {&amp;#xA;            var video = document.getElementById(&amp;#x27;my-video_html5_api&amp;#x27;); // Updated ID to target the correct video element&amp;#xA;            var hls = new Hls();&amp;#xA;            hls.loadSource(&amp;#x27;https://myStream.mysite.com/hls/index.m3u8&amp;#x27;);&amp;#xA;            hls.attachMedia(video);&amp;#xA;            hls.on(Hls.Events.MANIFEST_PARSED,function() {&amp;#xA;                video.play();&amp;#xA;            });&amp;#xA;        } else if (video.canPlayType(&amp;#x27;application/vnd.apple.mpegurl&amp;#x27;)) {&amp;#xA;            video.src = &amp;#x27;https://myStream.mysite.com/hls/index.m3u8&amp;#x27;;&amp;#xA;            video.addEventListener(&amp;#x27;loadedmetadata&amp;#x27;, function() {&amp;#xA;                video.play();&amp;#xA;            });&amp;#xA;        }&amp;#xA;    &lt;/script&gt;&#xA;&#xA;&#xA;

    &#xA;

    Has anyone experienced similar issues or can spot an error in my configuration ? Any help would be greatly appreciated as I have already invested over 30 hours trying to resolve this.

    &#xA;