m3u8 video playback within snazzy maps












1















I am using snazzy maps custom info window to display HLS video however i am unable to get it to work. videos work outside of the map area however not within the info window itself



  $(function() {
// Create the map
var map = new google.maps.Map($('.map-canvas')[0], {
zoom: 6,
styles: mapStyle,
center: new google.maps.LatLng(42.7875265, -101.0458982)
});
var locations = [
['Cobram Barooga Golf Club', 40.4840985, -106.8686117]
];
// Set up handle bars
var template = Handlebars.compile($('#marker-content-
template').html());
if (document.getElementById("video1")) {
videojs("video1").ready(function() {
});
}

for (i = 0; i < locations.length; i++) {
marker = new google.maps.Marker({
position: new google.maps.LatLng(locations[i][1], locations[i][2]),
map: map
});
// Set up a close delay for CSS animations
var info = null;
var closeDelayed = false;
var closeDelayHandler = function() {
$(info.getWrapper()).removeClass('active');
setTimeout(function() {
closeDelayed = true;
info.close();
}, 300);
};

// Add a Snazzy Info Window to the marker
info = new SnazzyInfoWindow({
marker: marker,
wrapperClass: 'custom-window',
offset: {
top: '10px'
},
edgeOffset: {
top: 50,
right: 60,
bottom: 50
},
border: false,
closeButtonMarkup: '<button type="button" class="custom-close"></button>',
content: template({
stuff:"",
}),
callbacks: {
open: function() {
$(this.getWrapper()).addClass('open');
},
afterOpen: function() {
var wrapper = $(this.getWrapper());
wrapper.addClass('active');
wrapper.find('.custom-close').on('click', closeDelayHandler);
},
beforeClose: function() {
if (!closeDelayed) {
closeDelayHandler();
return false;
}
return true;
},
afterClose: function() {
var wrapper = $(this.getWrapper());
wrapper.find('.custom-close').off();
wrapper.removeClass('open');
closeDelayed = false;
}
}
});

}
// Open the Snazzy Info Window

});'


<script id="marker-content-template" type="text/x-handlebars-template">
<section>
<video id="video" class="video-js vjs-default-skin" controls preload="auto" width="640" height="268">
<source src="http://d2zihajmogu5jn.cloudfront.net/bipbop-advanced/bipbop_16x9_variant.m3u8" type="application/x-mpegURL">




when using mp4 it works well but the HLS uses m3u8 VLS feed.



Anyone have a thought or am i going by this all wrong?



Thanks in advance for help










share|improve this question





























    1















    I am using snazzy maps custom info window to display HLS video however i am unable to get it to work. videos work outside of the map area however not within the info window itself



      $(function() {
    // Create the map
    var map = new google.maps.Map($('.map-canvas')[0], {
    zoom: 6,
    styles: mapStyle,
    center: new google.maps.LatLng(42.7875265, -101.0458982)
    });
    var locations = [
    ['Cobram Barooga Golf Club', 40.4840985, -106.8686117]
    ];
    // Set up handle bars
    var template = Handlebars.compile($('#marker-content-
    template').html());
    if (document.getElementById("video1")) {
    videojs("video1").ready(function() {
    });
    }

    for (i = 0; i < locations.length; i++) {
    marker = new google.maps.Marker({
    position: new google.maps.LatLng(locations[i][1], locations[i][2]),
    map: map
    });
    // Set up a close delay for CSS animations
    var info = null;
    var closeDelayed = false;
    var closeDelayHandler = function() {
    $(info.getWrapper()).removeClass('active');
    setTimeout(function() {
    closeDelayed = true;
    info.close();
    }, 300);
    };

    // Add a Snazzy Info Window to the marker
    info = new SnazzyInfoWindow({
    marker: marker,
    wrapperClass: 'custom-window',
    offset: {
    top: '10px'
    },
    edgeOffset: {
    top: 50,
    right: 60,
    bottom: 50
    },
    border: false,
    closeButtonMarkup: '<button type="button" class="custom-close"></button>',
    content: template({
    stuff:"",
    }),
    callbacks: {
    open: function() {
    $(this.getWrapper()).addClass('open');
    },
    afterOpen: function() {
    var wrapper = $(this.getWrapper());
    wrapper.addClass('active');
    wrapper.find('.custom-close').on('click', closeDelayHandler);
    },
    beforeClose: function() {
    if (!closeDelayed) {
    closeDelayHandler();
    return false;
    }
    return true;
    },
    afterClose: function() {
    var wrapper = $(this.getWrapper());
    wrapper.find('.custom-close').off();
    wrapper.removeClass('open');
    closeDelayed = false;
    }
    }
    });

    }
    // Open the Snazzy Info Window

    });'


    <script id="marker-content-template" type="text/x-handlebars-template">
    <section>
    <video id="video" class="video-js vjs-default-skin" controls preload="auto" width="640" height="268">
    <source src="http://d2zihajmogu5jn.cloudfront.net/bipbop-advanced/bipbop_16x9_variant.m3u8" type="application/x-mpegURL">




    when using mp4 it works well but the HLS uses m3u8 VLS feed.



    Anyone have a thought or am i going by this all wrong?



    Thanks in advance for help










    share|improve this question



























      1












      1








      1








      I am using snazzy maps custom info window to display HLS video however i am unable to get it to work. videos work outside of the map area however not within the info window itself



        $(function() {
      // Create the map
      var map = new google.maps.Map($('.map-canvas')[0], {
      zoom: 6,
      styles: mapStyle,
      center: new google.maps.LatLng(42.7875265, -101.0458982)
      });
      var locations = [
      ['Cobram Barooga Golf Club', 40.4840985, -106.8686117]
      ];
      // Set up handle bars
      var template = Handlebars.compile($('#marker-content-
      template').html());
      if (document.getElementById("video1")) {
      videojs("video1").ready(function() {
      });
      }

      for (i = 0; i < locations.length; i++) {
      marker = new google.maps.Marker({
      position: new google.maps.LatLng(locations[i][1], locations[i][2]),
      map: map
      });
      // Set up a close delay for CSS animations
      var info = null;
      var closeDelayed = false;
      var closeDelayHandler = function() {
      $(info.getWrapper()).removeClass('active');
      setTimeout(function() {
      closeDelayed = true;
      info.close();
      }, 300);
      };

      // Add a Snazzy Info Window to the marker
      info = new SnazzyInfoWindow({
      marker: marker,
      wrapperClass: 'custom-window',
      offset: {
      top: '10px'
      },
      edgeOffset: {
      top: 50,
      right: 60,
      bottom: 50
      },
      border: false,
      closeButtonMarkup: '<button type="button" class="custom-close"></button>',
      content: template({
      stuff:"",
      }),
      callbacks: {
      open: function() {
      $(this.getWrapper()).addClass('open');
      },
      afterOpen: function() {
      var wrapper = $(this.getWrapper());
      wrapper.addClass('active');
      wrapper.find('.custom-close').on('click', closeDelayHandler);
      },
      beforeClose: function() {
      if (!closeDelayed) {
      closeDelayHandler();
      return false;
      }
      return true;
      },
      afterClose: function() {
      var wrapper = $(this.getWrapper());
      wrapper.find('.custom-close').off();
      wrapper.removeClass('open');
      closeDelayed = false;
      }
      }
      });

      }
      // Open the Snazzy Info Window

      });'


      <script id="marker-content-template" type="text/x-handlebars-template">
      <section>
      <video id="video" class="video-js vjs-default-skin" controls preload="auto" width="640" height="268">
      <source src="http://d2zihajmogu5jn.cloudfront.net/bipbop-advanced/bipbop_16x9_variant.m3u8" type="application/x-mpegURL">




      when using mp4 it works well but the HLS uses m3u8 VLS feed.



      Anyone have a thought or am i going by this all wrong?



      Thanks in advance for help










      share|improve this question
















      I am using snazzy maps custom info window to display HLS video however i am unable to get it to work. videos work outside of the map area however not within the info window itself



        $(function() {
      // Create the map
      var map = new google.maps.Map($('.map-canvas')[0], {
      zoom: 6,
      styles: mapStyle,
      center: new google.maps.LatLng(42.7875265, -101.0458982)
      });
      var locations = [
      ['Cobram Barooga Golf Club', 40.4840985, -106.8686117]
      ];
      // Set up handle bars
      var template = Handlebars.compile($('#marker-content-
      template').html());
      if (document.getElementById("video1")) {
      videojs("video1").ready(function() {
      });
      }

      for (i = 0; i < locations.length; i++) {
      marker = new google.maps.Marker({
      position: new google.maps.LatLng(locations[i][1], locations[i][2]),
      map: map
      });
      // Set up a close delay for CSS animations
      var info = null;
      var closeDelayed = false;
      var closeDelayHandler = function() {
      $(info.getWrapper()).removeClass('active');
      setTimeout(function() {
      closeDelayed = true;
      info.close();
      }, 300);
      };

      // Add a Snazzy Info Window to the marker
      info = new SnazzyInfoWindow({
      marker: marker,
      wrapperClass: 'custom-window',
      offset: {
      top: '10px'
      },
      edgeOffset: {
      top: 50,
      right: 60,
      bottom: 50
      },
      border: false,
      closeButtonMarkup: '<button type="button" class="custom-close"></button>',
      content: template({
      stuff:"",
      }),
      callbacks: {
      open: function() {
      $(this.getWrapper()).addClass('open');
      },
      afterOpen: function() {
      var wrapper = $(this.getWrapper());
      wrapper.addClass('active');
      wrapper.find('.custom-close').on('click', closeDelayHandler);
      },
      beforeClose: function() {
      if (!closeDelayed) {
      closeDelayHandler();
      return false;
      }
      return true;
      },
      afterClose: function() {
      var wrapper = $(this.getWrapper());
      wrapper.find('.custom-close').off();
      wrapper.removeClass('open');
      closeDelayed = false;
      }
      }
      });

      }
      // Open the Snazzy Info Window

      });'


      <script id="marker-content-template" type="text/x-handlebars-template">
      <section>
      <video id="video" class="video-js vjs-default-skin" controls preload="auto" width="640" height="268">
      <source src="http://d2zihajmogu5jn.cloudfront.net/bipbop-advanced/bipbop_16x9_variant.m3u8" type="application/x-mpegURL">




      when using mp4 it works well but the HLS uses m3u8 VLS feed.



      Anyone have a thought or am i going by this all wrong?



      Thanks in advance for help







      javascript google-maps handlebars.js video.js






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Jan 1 at 16:48







      DigitalOutcast

















      asked Dec 31 '18 at 23:54









      DigitalOutcastDigitalOutcast

      4529




      4529
























          1 Answer
          1






          active

          oldest

          votes


















          0














          I had to place the script within the callback: I simply added videojs("video1"); to the afterOpen: I hope this helps someone in the future.






          share|improve this answer























            Your Answer






            StackExchange.ifUsing("editor", function () {
            StackExchange.using("externalEditor", function () {
            StackExchange.using("snippets", function () {
            StackExchange.snippets.init();
            });
            });
            }, "code-snippets");

            StackExchange.ready(function() {
            var channelOptions = {
            tags: "".split(" "),
            id: "1"
            };
            initTagRenderer("".split(" "), "".split(" "), channelOptions);

            StackExchange.using("externalEditor", function() {
            // Have to fire editor after snippets, if snippets enabled
            if (StackExchange.settings.snippets.snippetsEnabled) {
            StackExchange.using("snippets", function() {
            createEditor();
            });
            }
            else {
            createEditor();
            }
            });

            function createEditor() {
            StackExchange.prepareEditor({
            heartbeatType: 'answer',
            autoActivateHeartbeat: false,
            convertImagesToLinks: true,
            noModals: true,
            showLowRepImageUploadWarning: true,
            reputationToPostImages: 10,
            bindNavPrevention: true,
            postfix: "",
            imageUploader: {
            brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
            contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
            allowUrls: true
            },
            onDemand: true,
            discardSelector: ".discard-answer"
            ,immediatelyShowMarkdownHelp:true
            });


            }
            });














            draft saved

            draft discarded


















            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53992200%2fm3u8-video-playback-within-snazzy-maps%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown

























            1 Answer
            1






            active

            oldest

            votes








            1 Answer
            1






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes









            0














            I had to place the script within the callback: I simply added videojs("video1"); to the afterOpen: I hope this helps someone in the future.






            share|improve this answer




























              0














              I had to place the script within the callback: I simply added videojs("video1"); to the afterOpen: I hope this helps someone in the future.






              share|improve this answer


























                0












                0








                0







                I had to place the script within the callback: I simply added videojs("video1"); to the afterOpen: I hope this helps someone in the future.






                share|improve this answer













                I had to place the script within the callback: I simply added videojs("video1"); to the afterOpen: I hope this helps someone in the future.







                share|improve this answer












                share|improve this answer



                share|improve this answer










                answered Jan 5 at 6:41









                DigitalOutcastDigitalOutcast

                4529




                4529
































                    draft saved

                    draft discarded




















































                    Thanks for contributing an answer to Stack Overflow!


                    • Please be sure to answer the question. Provide details and share your research!

                    But avoid



                    • Asking for help, clarification, or responding to other answers.

                    • Making statements based on opinion; back them up with references or personal experience.


                    To learn more, see our tips on writing great answers.




                    draft saved


                    draft discarded














                    StackExchange.ready(
                    function () {
                    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53992200%2fm3u8-video-playback-within-snazzy-maps%23new-answer', 'question_page');
                    }
                    );

                    Post as a guest















                    Required, but never shown





















































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown

































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown







                    Popular posts from this blog

                    MongoDB - Not Authorized To Execute Command

                    How to fix TextFormField cause rebuild widget in Flutter

                    in spring boot 2.1 many test slices are not allowed anymore due to multiple @BootstrapWith