Using the Default.js File in Player V3 (Deprecated)

The default.js file defines the DOM object handle and is auto-loaded at the beginning processing.

Note: Ooyala Player V3 has been deprecated and is scheduled to be disabled. For details and alternatives, see the OVP Release Notes.
The default.js file defines the DOM object handle and is auto-loaded at the beginning processing. When a user selects the app, the default.html file is loaded and all its references to other files. The default.js file is loaded next followed by the player.html file. The default html notifies the player.html that there is an action to perform and indicates that it should begin its actions.

Windows 8 apps use a model, where each app is contained in a sandbox. This allows for much better control and prevents one app from affecting another. However, as a result of this model, you will need to provide a set of Web Services or other means of accessing remote data as if it were coming from a server on the web.

In the default.js file you can post messages to the iframe container using a data-store to access remote data as if it were coming from a server on the web.

 
  // For an introduction to the Blank template, see the following 
 documentation:
// http://go.microsoft.com/fwlink/?LinkId=232509
 (function () {
    "use strict";


 var app = WinJS.Application;
 var activation = Windows.ApplicationModel.Activation;
 WinJS.strictProcessing();

 app.onactivated = function (args) {
   if (args.detail.kind === activation.ActivationKind.launch) {
   if (args.detail.previousExecutionState !== activation.
      ApplicationExecutionState.terminated) {
      // TODO: This application has been newly launched. Initialize
      // your application here.
         app.ooplayer = document.getElementById('ooplayer');
         app.ooplayer.contentWindow.postMessage({ eventType: 'startApp'
          }, "ms-appx-web://" + document.location.host);
           } else {
       // TODO: This application has been reactivated from suspension.
       // Restore application state here.
          }
           args.setPromise(WinJS.UI.processAll());
       }
    };

 app.oncheckpoint = function (args) {
     // TODO: This application is about to be suspended. Save any state
     // that needs to persist across suspensions here. You might use the
     // WinJS.Application.sessionState object, which is automatically
     // saved and restored across suspension. If you need to complete an
     // asynchronous operation before your application is suspended, call
     // args.setPromise().
    };

    app.start();

})();

해당 내용이 도움 되었습니까?