Tabs initialization


I am trying to initialize flowplayer mediaplayer ( in an Ionic 2 tabs application. When I put flowplayer in the first tab it initializes and displays correctly. But when I put it on the second or third tab flowplayer object does not initialize properly. Console log contains no errors. Also I’ve tried to change " selectedIndex" parameter and flowplayer initializes correctly only on indicated tab. Please tell me how tab sequence may influence the initialization of JS objects?


Cordova CLI: 6.3.0
Ionic Framework Version: 2.0.1
Ionic CLI Version: 2.2.1
Ionic App Lib Version: 2.2.0
Ionic App Scripts Version: 1.0.0
ios-deploy version: Not installed
ios-sim version: Not installed
OS: Linux 3.16
Node Version: v7.4.0

Can you share some code as to what you have tried?

Hi mhartington,

Please see my code below.

home.html and about.html

<ion-content padding>

  <div class="flowplayer fp-slim"
       <video autoplay>
          <source type="application/x-mpegurl" src="">


<html lang="en" dir="ltr">

  <link rel="stylesheet" href="//">
  <script src="//"></script>
  <script src="//"></script>

    flowplayer(function (api) { = true;


       api.on("load ready", function (e, api, video) {
         var log = $("<p/>").text(e.type + ": " + video.src + ", duration: " +
                              (video.duration || "not available"));



    $(function () {
       // load clip object
       $("button:first").click(function () {
          // flowplayer(0).support
             sources: [
               { type: "application/x-mpegurl", src: "//" }//,
               // { type: "video/mp4",  src: "//" }

       // string argument to load()
       $("button:last").click(function() {



  <!-- Ionic's root component and where the app will load -->

  <!-- The polyfills js is generated during the build process -->
  <script src="build/polyfills.js"></script>

  <!-- The bundle js is generated during the build process -->
  <script src="build/main.js"></script>


Today I’ve got error message when player was placed in a second tab:

error Uncaught TypeError: Cannot read property ‘domAvailable’ of null,, Line: 3

Maybe this helps?