• Quick Start
  • Booting
  • Platform
  • Portals
  • References
    • API Reference TOI3
    • IIP Reference
  • Resources
ARRIS Enterprises, Inc. Confidential Information

Simple DVR page

This page shows how to record and play-back an asset.


var recorder;
var recordedAsset;
var is;


function startRecording()
{
  is = toi.informationService;
  recorder = toi.mediaService.createRecorderInstance();
  var assetId = toi.assetManagerService.createAsset(toi.assetManagerService.ASSET_PVR);
  recorder.open("224.5.5.1:11111", assetId);
  recorder.record();
  is.setObject(is.CFG_STANDBY_ALLOWREBOOT, is.VALUE_FALSE, is.STORAGE_VOLATILE);
  var propList = new Array(PROPERTY_SYSTEM_PLAYBACKURI);
  var properties = toi.assetManagerService.getProperties(assetId, propList);
  recordedAsset = properties[0].value;
  recorderTmr = setTimeout("recorderTimeout()", 20000);
}

function recorderTimeout()
{
  recorder.close();
  is.setObject(is.CFG_STANDBY_ALLOWREBOOT, is.VALUE_TRUE, is.STORAGE_VOLATILE);
  playRecording();
}

function playRecording()
{
  try {
    player = toi.mediaService.createPlayerInstance();
    player.open(recordedAsset);
    player.play(1000);
  }
  catch(e) {
    alert("Error: " + e);
  }
}

5.1.p5

Copyright (c) 2017 ARRIS Enterprises, LLC. All Rights Reserved. ARRIS Enterprises, LLC. Confidential Information.