locked
Radio link doesnt work google chrome RRS feed

  • Question

  • User197255166 posted

    Hi,

    A radio is running within the page. The page starts with https, while the radio link starts with http.

    Therefore google sees this as mixed content and does not run it. I cannot https the radio link. How can I solve this problem. 

    Can't i do this with code. This is my purpose.

    I tried below link. But it doesnt work.

    https://web.dev/fixing-mixed-content/

    HTML

    <div class="container-fluid">
          <div class="row">
              <div class="col-md-4">
                  <div class="row" id="radiolist">
                      <div class="col-sm-12">
                          <a href="#" id="Main">Radio LTB Commercial</a>
                      </div>
                      <div class="col-sm-12">
                          <a href="#" id="Rock">Radio LTB Rock</a>
                      </div>
                      <div class="col-sm-12">
                          <a href="#" id="Electronica">Radio LTB Electronica</a>
                      </div>
                      <div class="col-sm-12">
                          <a href="#" id="Lounge">Radio LTB Lounge</a>
                      </div>
                  </div>
              </div>
              <div class="col-md-8">
                  <audio id="radio" autoplay controls="controls" preload="none" style="width:100%">
                      <source id="radsrc" src="http://strm.radioltb.com:8000/Main?type=http&amp;nocache=201" type="audio/mp3" />
                  </audio>
              </div>
          </div>
      </div>

    JS

    <script type="text/javascript">
     
     
           $(function () {
     
               playClicked(@Model);
     
               $("#radiolist a").click(function (event) {
                   var radioId = event.target.id;
                   $("#radiolist a").css("font-weight", "normal");
     
                   var rad = document.getElementById('radio');
                   var sor = document.getElementById('radsrc');
                   sor.src = 'http://strm.radioltb.com:8000/' + radioId + '?type=http&amp;nocache=201';
     
     
                   rad.load();
                   rad.play();
     
                   $("#" + radioId).css("font-weight", "bold");
               })
     
     
               function playClicked(rid) {
                   var radioName;
     
                   $("#radiolist a").css("font-weight", "normal");
                   if (rid == 1) {
                       radioName = "Main";
     
                   }
                   else if (rid == 2) {
                       radioName = "Rock";
     
                   }
                   else if (rid == 3) {
                       radioName = "Electronica";
                   }
                   else if (rid == 4) {
                       radioName = "Lounge";
                   }
     
                   $("#" + radioName).css("font-weight", "bold");
     
                   var rad = document.getElementById('radio');
                   var sor = document.getElementById('radsrc');
                   sor.src = 'http://strm.radioltb.com:8000/' + radioName + '?type=http&amp;nocache=201';
     
     
                   rad.load();
                   rad.play();
     
               }
     
     
     
           })
       </script>

    Tuesday, December 22, 2020 4:23 AM

All replies

  • User-939850651 posted

    Hi Aliyilmaz,

    An HTTPS page that includes content fetched using cleartext HTTP is called a mixed content page. Pages like this are only partially encrypted,

    leaving the unencrypted content accessible to sniffers and man-in-the-middle attackers. That leaves the pages unsafe.

    Due to security issues, the chrome browser will block these contents.

    So I think the best solution is to switch the audio server to HTTPS.

    More details, please refer to this document below:

    https://developer.mozilla.org/en-US/docs/Web/Security/Mixed_content#Mixed_active_content

    Best regards,

    Xudong Peng

    Tuesday, December 22, 2020 10:36 AM
  • User197255166 posted

    Hi,

    yes I know. Isn't there a solution to this with code? I'm actually investigating it.

    I'm sending you a site as an example. This site can do as I want. How does this site do?

    https://www.ntvradyo.com.tr/

    In the upper right corner there is a live radio link in red. main site https but radio link http.

    Wednesday, December 23, 2020 7:11 AM
  • User753101303 posted

    Hi,

    Seems this link is just opening another http page as a popup so that it can then play http content without this restriction.

    The "mixed content" restriction applies when trying to load http content as part of a main document shown using https.

    Wednesday, December 23, 2020 1:26 PM