define(function(require, exports, module) {
  'use strict';
  var TSCORE = require("tscore");
  console.log("Loading: ext.api.js");
  
  window.addEventListener("message", handleMessage , false);

  function handleMessage(msg) {
    var data = JSON.parse(msg.data);
    var command = data.command;

    switch (command) {
      case "openLinkExternally":
        if (data.link) {
          openLinkExternally(data.link);
        }
        break;
      case "contentChangedInEditor":
        TSCORE.FileOpener.setFileChanged(true);
        break;
      default:
        console.log("Not recognized messaging command: " + msg);
        break;
    }
  }

  function openLinkExternally(uri) {
    uri = decodeURIComponent(uri);
    if (
        uri.indexOf("http://") === 0 ||
        uri.indexOf("https://") === 0 ||
        uri.indexOf("file://") === 0
    ) {
      TSCORE.IO.openFile(uri);
    } else {
      console.log("Not supported URL format: " + uri);
    }
  }

});
@@ -311,24 +311,184 @@
 (command) %7B%0A
+      case %22endedVideo%22:%0A        if(data)%7B%0A          console.log(data);%0A          openVideoFileFormat(data);%0A        %7D else %7Bconsole.log('err')%7D%0A        break;%0A
       case %22
@@ -805,16 +805,152 @@
  %7D%0A  %7D%0A%0A
+  function openVideoFileFormat(filePath) %7B%0A%0A    if(TSCORE.selectedFiles%5B0%5D) %7B%0A      TSCORE.FileOpener.getNextFile(filePath);%0A    %7D%0A  %7D%0A%0A
   functi

Update plyr.io version in AudioVideo player