Ejemplo VOD con PDK

Preroll – Midroll (60s) – Postroll – Seteo de Calidad incial

http://edgelab.edge-apps.net/magmaVOD/

—-

 

<!DOCTYPE HTML>
<html>
<head>
 <title>Test VOD</title>
 <meta http-equiv="content-type" content="text/html; charset=utf-8" />
 <script src="//code.jquery.com/jquery-1.11.3.min.js"></script>
 <script src="//code.jquery.com/jquery-migrate-1.2.1.min.js"></script>
 <script src="https://statics.fluvio.tv/integration/js/pdk.js"></script>

</head>
<body>
 <div id="vod"></div>
 <p>Preroll - Midroll (60s) - Postroll - Seteo de Calidad incial</p>
 <script type="text/javascript">
 $(document).ready(function(){
 player2 = LayerPlayer("vod");
 player2.setup({
 asset: '518a38cc9a0173d0b2dc088166981cf8-1417113138-30c08c3bbfac55eba7678594e5da022e',
 assetType: 'vod',
 width: "500px",
 height: "400px",
 dynamicIndex: '3',
 advertising: {
 client: 'vast',
 schedule: {
 preroll: {
 offset: "pre",
 tag: 'http://ads.e-planning.net/eb/4/143b7/Home/Preroll?o=v&ma=1&vv=1'
 },
 ad2: {
 offset: 60,
 tag: 'http://ads.e-planning.net/eb/4/143b7/Home/Preroll?o=v&ma=1&vv=1',
 type: 'mid'
 },
 postroll: {
 offset: 'post',
 tag: 'http://ads.e-planning.net/eb/4/143b7/Home/Preroll?o=v&ma=1&vv=1',
 type: 'post'
 } 
 }
 }
 });


// sin esto no hace el seteo de la calidad, bug con el autoplay
 player2.onReady(function(event){
 setTimeout(function(){
 player2.play();
 },500);
 });
 
 });

 </script>
</body>
</html>

 

 

API – Uso y consumo de cuenta

Uso

WebService URL:

http://magma.edge-americas.com/api/1.1/administration/getUsageForReportingAccount.json.php

Special Header:

 Authentication: VMAuth {api-key}

POST Variables:

{
 "reportingAccount": {optional reporting account number},
 "dateFrom": {initial date in YYYYMMDD format},
 "dateTo": {final date in YYYYMMDD format},
 "edgeAccount": {optional true|false} (spread Edge accounts; sum up Fibercorp accounts),
 "resume": {optional true|false} (sum up all accounts)
}

 

Ejemplo 1

WebService URL:

http://magma.edge-americas.com/api/1.1/vod/search.json.php

Special Header:

 Authentication: VMAuth 84c43749dfcbde1d3f9f684eb19fb465-8f3ae0f7f71cc78667e2a3f8b5ba4c

POST Variables:

{
"reportingAccount": 10003,
 "dateFrom": 20141009,
 "dateTo": 20141009
}

Resultado:

{
 "status": "ok",
 "dateFrom": "20141009",
 "dateTo": "20141009",
 "usage": {
   "live": {
   "volume": "723370.9746",
   "concurrencyPeak": "737"
  },
   "vod": {
   "volume": 0,
   "concurrencyPeak": 0,
   "storageUsage": "19774.27499004364"
  },
  "reportingAccount": "10003"
 }
}


Ejemplo 2

WebService URL:

http://magma.edge-americas.com/api/1.1/vod/search.json.php

Special Header:

 Authentication: VMAuth 84c43749dfcbde1d3f9f684eb19fb465-8f3ae0f7f71cc78667e2a3f8b5ba4c

POST Variables:

{
 "dateFrom": 20141009,
 "dateTo": 20141011,
 "resume": true
}

Resultado:

{
 "status": "ok",
 "dateFrom": "20141009",
 "dateTo": "20141011",
 "usage": {
   "20000": {
     "vod": {
       "volume": 0,
       "storageUsage": "114.82460090637208",
       "concurrencyPeak": 0
     },
     "live": {
       "volume": 0,
       "concurrencyPeak": null
     }
  },
   "20001": {
     "vod": {
       "volume": 0,
       "storageUsage": null,
       "concurrencyPeak": 0
     },
     "live": {
       "volume": 0,
       "concurrencyPeak": null
     }
  },
  "fibercorp": {
    "vod": {
      "volume": 0,
      "storageUsage": 88782.236520481,
      "concurrencyPeak": 0
    },
    "live": {
      "volume": 14251591.3187,
      "concurrencyPeak": "5795"
    }
  }
}

Ejemplo 3

WebService URL:

http://magma.edge-americas.com/api/1.1/vod/search.json.php

Special Header:

 Authentication: VMAuth 84c43749dfcbde1d3f9f684eb19fb465-8f3ae0f7f71cc78667e2a3f8b5ba4c

POST Variables:

{
 "dateFrom": 20141009,
 "dateTo": 20141011
}

Resultado:

{
 "status": "ok",
 "dateFrom": "20141009",
 "dateTo": "20141011",
 "usage": {
   "10001": {
     "vod": {
       "volume": 0,
       "storageUsage": "114.82460090637208",
       "concurrencyPeak": 0
     },
     "live": {
       "volume": 0,
       "concurrencyPeak": null
     }
  },
   "10003": {
     "vod": {
       "volume": 0,
       "storageUsage": null,
       "concurrencyPeak": 0
     },
     "live": {
       "volume": 0,
       "concurrencyPeak": null
     }
  },
  "99999": {
    "vod": {
      "volume": 0,
      "storageUsage": 88782.236520481,
      "concurrencyPeak": 0
    },
    "live": {
      "volume": 14251591.3187,
      "concurrencyPeak": "5795"
    }
  }
}

Ejemplo 4

WebService URL:

http://magma.edge-americas.com/api/1.1/vod/search.json.php

Special Header:

 Authentication: VMAuth 84c43749dfcbde1d3f9f684eb19fb465-8f3ae0f7f71cc78667e2a3f8b5ba4c

POST Variables:

{
 "dateFrom": 20141009,
 "dateTo": 20141011,
 "edgeAccount": true
}

Resultado:

{
 "status": "ok",
 "dateFrom": "20141009",
 "dateTo": "20141011",
 "usage": {
   "edge": {
     "vod": {
       "volume": 0,
       "storageUsage": 24344.018223128,
       "concurrencyPeak": 0
     },
     "live": {
       "volume": 12535812.6568,
       "concurrencyPeak": "9511"
     }
   },
   "fibercorp": {
     "vod": {
       "volume": 0,
       "storageUsage": 88782.236520481,
       "concurrencyPeak": 0
     },
     "live": {
       "volume": 14251591.3187,
       "concurrencyPeak": "5795"
     }
   }
 }
}

API – Búsqueda de videos

Uso

WebService URL:

http://magma.edge-americas.com/api/1.1/vod/search.json.php

Special Header:

 Authentication: VMAuth {api-key}

POST Variables:

{
 "q": {optional string},
 "title": true|false,
 "description": true|false,
 "hash": true|false,
 "author": true|false,
 "tags": true|false,
 "publishDate": true|false,
 "limitCount": {optional max count},
 "limitFrom": {optional start-from number}
}

 

Ejemplo

WebService URL:

http://magma.edge-americas.com/api/1.1/vod/search.json.php

Special Header:

 Authentication: VMAuth 84c43749dfcbde1d3f9f684eb19fb465-8f3ae0f7f71cc78667e2a3f8b5ba4c

POST Variables:

{
 "q": "China",
 "title": true,
 "description": false,
 "hash": false,
 "author": false,
 "tags": false,
 "publishDate": false,
 "limitCount": 20,
 "limitFrom": 10
}

Resultado:

{
 "n": 20,
 "videos": [
 {
  "id": "1209",
  "title": "La_China_Suarez_y_Fer_Dente_en_Tu_cara_me_suena_HD.flv",
  "tags": "",
  "description": "",
  "author": "",
  "storageHash": "ddfc89d697e00b4fef9c4738f4c34dd4-1415634103-3001ef257407d5a371a96dcd947c7d93",
  "customMetadata": "",
  "raId": "20044",
  "duration": "264.32",
  "status": "200",
  "width": "426",
  "height": "240",
  "publishingDate": "2014-11-10 09:41:43",
  "poster": http://vod.magma.qaotic.net/media/0/ddfc89d697e00b4fef9c4738f4c34dd4-1415634103-3001ef257407d5a371a96dcd947c7d93/poster.jpg
  }
 ]
}

API – Obtener StreamNames

Uso

WebService URL:

http://magma.edge-americas.com/api/1.1/administration/getRA.json.php

Special Header:

 Authentication: VMAuth {admin api-key}

POST Variables:

 None

 

Ejemplo

WebService URL:

http://magma.edge-americas.com/api/1.1/administration/getRA.json.php

Special Header:

 Authentication: VMAuth 84c43749dfcbde1d3f9f684eb19fb465-8f3ae0f7f71cc78667e2a3f8b5ba4c

Resultado:

{
 status: "ok"
 -streams: [
  "AGEA_CLARIN-20003",
  "agro01-20046",
  "agro02-20046",
  "agro03-20046"
  ]
}