Skip to content
This repository

Added a demo for Akamai Media Analytics #205

Closed
wants to merge 2 commits into from

3 participants

Avi Vaisenberger Kaltura bot Michael Dale
Avi Vaisenberger

*** Test ***

Kaltura bot
Owner

Live Pull Request Urls

Kaltura bot
Owner

Updated pull request 205: d344f85

Kaltura bot
Owner

Updated pull request 205: 0216b44

Kaltura bot
Owner

Updated pull request 205: 9b88072

Kaltura bot
Owner

Updated pull request 205: 5e572f7

Kaltura bot
Owner

Updated pull request 205: 634c78e

Kaltura bot
Owner

Updated pull request 205: c880a5b

Kaltura bot
Owner

Updated pull request 205: 3f0bf3a

Kaltura bot
Owner

Updated pull request 205: 4baae2f

Michael Dale
Owner
mdale commented July 29, 2012

please provide full description, configuration, and testing instructions :)

Kaltura bot
Owner

Updated pull request 205: c90e933

Michael Dale
Owner

@avivais don't know if your back yet; but this should probably forward ported to 1.7

Avi Vaisenberger avivais closed this September 24, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Showing 2 unique commits by 1 author.

Jul 29, 2012
Avi Vaisenberger Added Akamai Analytics demo 4baae2f
Aug 08, 2012
Avi Vaisenberger Added feature test file for Akamai Media Analytics c90e933
This page is out of date. Refresh to see the latest.
23  modules/AkamaiAnalytics/loader.js
... ...
@@ -0,0 +1,23 @@
  1
+( function( mw, $ ) { "use strict";
  2
+	
  3
+	mw.addResourcePaths( {
  4
+		"mw.AkamaiAnalytics" : "mw.AkamaiAnalytics.js"
  5
+	} );
  6
+
  7
+	// Check if the plugin is enabled: 
  8
+	$( mw ).bind( 'newEmbedPlayerEvent', function( event, embedPlayer ) {
  9
+		embedPlayer.bindHelper( 'KalturaSupport_CheckUiConf', function( event, $uiConf, callback ) {
  10
+			// Check if plugin exists
  11
+			if( embedPlayer.isPluginEnabled( 'akamaiAnalytics' ) ) {
  12
+				mw.load( [ "mw.AkamaiAnalytics" ], function() {
  13
+					// Pass the AkamaiAnalytics plugin
  14
+					embedPlayer.akamaiAnalytics = new mw.AkamaiAnalytics( embedPlayer, callback );
  15
+				} );
  16
+			} else {
  17
+				// No AkamaiAnalytics plugin issue callback to continue player build out
  18
+				callback();
  19
+			}
  20
+		});
  21
+	});
  22
+
  23
+} )( window.mw, window.jQuery );
32  modules/AkamaiAnalytics/mw.AkamaiAnalytics.js
... ...
@@ -0,0 +1,32 @@
  1
+( function( mw, $ ) {"use strict";
  2
+	mw.AkamaiAnalytics = function( embedPlayer, callback ) {
  3
+		return this.init( embedPlayer, callback );
  4
+	}
  5
+	
  6
+	mw.AkamaiAnalytics.prototype = {
  7
+		
  8
+		// Bind PostFix
  9
+		bindPostFix : '.akamaiAnalytics',
  10
+		
  11
+		getConfig: function( attr )  {
  12
+			return this.embedPlayer.getKalturaConfig( 'akamaiAnalytics', attr );
  13
+		},
  14
+
  15
+        init: function( embedPlayer, callback ) {
  16
+            var _this = this;
  17
+			this.embedPlayer = embedPlayer;
  18
+			// Unbind any existing bindings
  19
+			this.embedPlayer.unbindHelper( _this.bindPostFix );
  20
+	
  21
+			if ( _this.getConfig( 'trackEventMonitor' ) && window.parent[ _this.getConfig( 'trackEventMonitor' ) ] ) {
  22
+				this.trackEventMonitor = window.parent[ _this.getConfig( 'trackEventMonitor' ) ];
  23
+			}
  24
+			window.AKAMAI_MEDIA_ANALYTICS_CONFIG_FILE_PATH = this.getConfig( 'configPath' ) || 'http://ma193-r.analytics.edgesuite.net/config/beacon-2578.xml';
  25
+			window.parent.AKAMAI_MEDIA_ANALYTICS_CONFIG_FILE_PATH = window.AKAMAI_MEDIA_ANALYTICS_CONFIG_FILE_PATH;
  26
+			$.getScript( 'http://79423.analytics.edgesuite.net/html5/akamaihtml5-min.js', function() {
  27
+				setAkamaiMediaAnalyticsData( 'playerName', 'testPlayer', embedPlayer.pid );
  28
+				callback();
  29
+			} );
  30
+        }
  31
+	};
  32
+})( window.mw, window.jQuery );
70  modules/AkamaiAnalytics/tests/AkamaiAnalytics.qunit.html
... ...
@@ -0,0 +1,70 @@
  1
+<!DOCTYPE HTML>
  2
+<html>
  3
+	<head>
  4
+		<title>Akamai Analytics Test</title>
  5
+		
  6
+		<script type="text/javascript" src="../../../tests/qunit/qunit-bootstrap.js"></script>
  7
+		<script type="text/javascript" src="../../../mwEmbedLoader.php?debug=true"></script>
  8
+		
  9
+		<!-- qunit-kaltura must come after qunit-bootstrap.js and after mwEmbedLoader.php and after any jsCallbackReady stuff-->
  10
+		<script type="text/javascript" src="../../KalturaSupport/tests/resources/qunit-kaltura-bootstrap.js"></script>
  11
+		<script type="text/javascript">		
  12
+			function jsKalturaPlayerTest( videoId ) {
  13
+				module( "Akamai Analytics Plugin Test" );
  14
+				var kdp = $( '#kaltura_player' )[ 0 ];
  15
+				kdp.addJsListener( 'playerReady', 'testCallback' );
  16
+				window[ 'testCallback' ] = function() {
  17
+					test( "Akamai Analytics Configuration Path", function() {
  18
+						ok( window.AKAMAI_MEDIA_ANALYTICS_CONFIG_FILE_PATH, "Configuration File Path Is Set" );
  19
+						kdp.addJsListener( 'doPlay.playingCountTest', 'playCountCallback' );
  20
+						setTimeout( function() {
  21
+							kdp.sendNotification( 'doPlay' );
  22
+						}, 200 );
  23
+					} );
  24
+				}
  25
+				window[ 'playCountCallback' ] = function() {
  26
+					test( "Required Cookies Are Set", function() {
  27
+						stop();
  28
+						ok( $.cookie( 'AkamaiAnalytics_BrowserSessionId' ), "AkamaiAnalytics_BrowserSessionId Cookie Is Set" );
  29
+						setTimeout( function() {
  30
+							kdp.sendNotification( 'doPause' );
  31
+							equals( parseInt( $.cookie( 'HTML_isPlayingCount' ) ), 1, "HTML_isPlayingCount Is Incremented By 1" );
  32
+							start();
  33
+							kdp.removeJsListener( 'doPlay.playingCountTest', 'playCountCallback' );
  34
+						}, 1000 );
  35
+					} );
  36
+				}
  37
+			}
  38
+		</script>
  39
+
  40
+	</head>
  41
+
  42
+	<body>
  43
+		<h2> Akamai Analytics Test </h2>
  44
+		<a href="?forceMobileHTML5"> Force Mobile Safari</a> for testing with desktop chrome and safari.
  45
+		<br />
  46
+		<div id="player_container" style="float:left;" >
  47
+			<object id="kaltura_player" 
  48
+					name="kaltura_player_1339342398"
  49
+					type="application/x-shockwave-flash"
  50
+					allowFullScreen="true"
  51
+					allowNetworking="all"
  52
+					allowScriptAccess="always"
  53
+					height="330"
  54
+					width="400"
  55
+					bgcolor="#000000"
  56
+					xmlns:dc="http://purl.org/dc/terms/"
  57
+					xmlns:media="http://search.yahoo.com/searchmonkey/media/"
  58
+					rel="media:video"
  59
+					resource="http://www.kaltura.com/index.php/kwidget/cache_st/1339342398/wid/_861182/uiconf_id/8339802/entry_id/1_q89nq804"
  60
+					data="http://www.kaltura.com/index.php/kwidget/cache_st/1339342398/wid/_861182/uiconf_id/8339802/entry_id/1_q89nq804">
  61
+				<param name="allowFullScreen" value="true" />
  62
+				<param name="allowNetworking" value="all" />
  63
+				<param name="allowScriptAccess" value="always" />
  64
+				<param name="bgcolor" value="#000000" />
  65
+				<param name="flashVars" value="&" />
  66
+				<param name="movie" value="http://www.kaltura.com/index.php/kwidget/cache_st/1339342398/wid/_861182/uiconf_id/8339802/entry_id/1_q89nq804" />
  67
+			</object>			
  68
+		</div>
  69
+	</body>
  70
+</html>
179  modules/AkamaiAnalytics/tests/CSMASampleConfiguration.xml
... ...
@@ -0,0 +1,179 @@
  1
+<AkamaiPlayerAnalyticsConfig debug="0" logWindow="0" exception="0">
  2
+<beaconId>ec8af8d4c7c8e277</beaconId>
  3
+<beaconVersion>1.0</beaconVersion>
  4
+<isActive>1</isActive>
  5
+<logTo logType="relative" logInterval="30" secondaryLogTime="5" maxLogLineLength="2048">
  6
+	<host>csma82223.analytics.edgesuite.net</host>
  7
+	<path>/1.gif</path>
  8
+	<logVersion>1.1</logVersion>
  9
+	<formatVersion>1.1</formatVersion>
  10
+</logTo>
  11
+<security></security>
  12
+<bucketInfo>
  13
+  <bucketCount>10</bucketCount>
  14
+  <bucketLength>900</bucketLength>
  15
+</bucketInfo>
  16
+<statistics useKey="1">
  17
+  <common>
  18
+    <dataMetrics>
  19
+      <data name="eventCode" key="a"/>
  20
+      <data name="beaconId" key="b"/>
  21
+      <data name="sessionId" key="c"/>
  22
+      <data name="clientId" key="d"/>
  23
+      <data name="sequenceId" key="e"/>
  24
+      <data name="logType" key="f"/>
  25
+      <data name="endOfStream" key="g"/>
  26
+      <data name="logVersion" key="h"/>
  27
+	<data name="formatVersion" key="i"/>
  28
+    </dataMetrics>
  29
+  </common>
  30
+  <init eventCode="I">
  31
+    <dataMetrics>
  32
+     <data name="playerReferrer" key="af"/>
  33
+     <data name="pageUrl" key="ag"/>
  34
+     <data name="pageReferrer" key="ah"/>
  35
+     <data name="userAgent" key="ai"/>
  36
+     <data name="playerVersion" key="aj"/>
  37
+     <data name="playerType" key="ak"/>
  38
+     <data name="os" key="al"/>
  39
+     <data name="browser" key="at"/>
  40
+     <data name="pluginVersion" key="ay"/>
  41
+     <data name="beaconVersion" key="az"/>
  42
+
  43
+    <data name="browserSize" key="au"/>
  44
+    </dataMetrics>
  45
+  </init>
  46
+  <playStart eventCode="S">
  47
+    <dataMetrics>
  48
+ 	    <data name="hostName" key="aa"/>
  49
+    	<data name="appName" key="ab"/>
  50
+    	<data name="streamName" key="ac"/>
  51
+    	<data name="port" key="ad"/>
  52
+    	<data name="protocol" key="ae"/>
  53
+
  54
+    	<data name="format" key="am"/>
  55
+    	
  56
+    	<data name="connectTime" key="an"/>
  57
+    	<data name="bufferingTime" key="ao"/>
  58
+    	<data name="startupTime" key="ap"/>
  59
+    	<data name="streamLength" key="aq"/>
  60
+    	<data name="bytesTotal" key="ar"/>
  61
+    	<data name="encodedFPS" key="as"/>
  62
+    	
  63
+
  64
+    	<data name="videoSize" key="av"/>
  65
+    	<data name="streamUrl" key="aw"/>
  66
+     	<data name="deliveryType" key="ax"/>
  67
+      <data name="bucketLength" key="ba" />
  68
+      <data name="currentStreamTime" key="v" />
  69
+      <data name="currentClockTime" key="w" />
  70
+
  71
+    <!-- <data name="playListName" key="_plNm_" isCustom="true"/> -->
  72
+  
  73
+    <!--	<data name="streamTime" key="_dt_" key="">
  74
+    		  <extractFrom onEvent="metaData" fromKey="duration"/>
  75
+    	</data>
  76
+    	<data name="rateValues" key="_rt_" key="">
  77
+    		  <extractFrom onEvent="metaData" keyRegEx=".*rate$"/>
  78
+    	</data> -->
  79
+  	</dataMetrics>
  80
+  </playStart>
  81
+  <playing eventCode="P">
  82
+    <dataMetrics>
  83
+      <data name="playerState" key="m"/>
  84
+      
  85
+      <data name="playBackBitRate" key="n"/>
  86
+      <data name="audioBandwidth" key="o"/>
  87
+      <data name="videoBandwidth" key="p" />
  88
+      <data name="dataBandwidth" key="q" />
  89
+      <data name="audioBufferLength" key="r" />
  90
+      <data name="videoBufferLength" key="s" />
  91
+      <data name="dataBufferLength" key="t" />
  92
+      <data name="droppedFrames" key="u" />
  93
+      
  94
+      <data name="currentStreamTime" key="v" />
  95
+      <data name="currentClockTime" key="w" />
  96
+      
  97
+      <data name="playClockTime" key="x" />
  98
+      <data name="playStreamTime" key="y" />
  99
+      <data name="rebufferCount" key="z" />
  100
+      <data name="rebufferTime" key="da" />
  101
+      <data name="averageFPS" key="db"/>
  102
+      <data name="bytesLoaded" key="dc"/>
  103
+  
  104
+      <data name="pauseCount" key="dd" />
  105
+      <data name="pauseDuration" key="de" />
  106
+      <data name="pauseIntervalsAsString" key="df" />
  107
+      <data name="seekCount" key="dg" />
  108
+      <data name="seekTime" key="dh" />
  109
+      <data name="seekIntervalsAsString" key="di" />
  110
+      <data name="pauseSeekSession" key="dj" />
  111
+
  112
+      <data name="bandwidthPercent" key="dk"/>
  113
+      <data name="bufferLength" key="dl"/>
  114
+      <data name="averageFPSPercent" key="dm"/>
  115
+      <data name="totalBandwidth" key="dn"/>
  116
+      <data name="resumeBufferCount" key="do"/>
  117
+      <data name="resumeBufferTime" key="dp"/>
  118
+      <data name="bytesPlayed" key="dq"/>
  119
+      <data name="availableBandwidth" key="dr"/>
  120
+      <data name="fullScreenClockTime" key="ds"/>
  121
+      <data name="encodedBitRate" key="dt"/>
  122
+      <!--<data name="bucketDetails" key="" />-->
  123
+      <data name="bucketCount" key="ea" />
  124
+      <data name="bucketPlays" key="eb" />
  125
+      <data name="bucketPauseCounts" key="ec" />
  126
+      <data name="bucketPauseTimes" key="ed" />
  127
+      <data name="bucketSeeks" key="ee" />
  128
+      <data name="bucketForwardSeeks" key="ef" />
  129
+      <data name="bucketBackwardSeeks" key="eg" />
  130
+      <data name="bucketRebufferCounts" key="eh" />
  131
+      <data name="bucketRebufferTimes" key="ei" />
  132
+      <data name="bucketResumeBufferCounts" key="ej" />
  133
+      <data name="bucketResumeBufferTimes" key="ek" />
  134
+      <data name="bucketSeekTimes" key="el" />
  135
+      <data name="bucketFullScreenTimes" key="em" />
  136
+  
  137
+      <!--<data name="transitionStartCount" key="fa" />-->
  138
+      <data name="transitionCount" key="fb" />
  139
+      <!--<data name="transitionInCompleteCount" key="fc" />-->
  140
+      <data name="transitionUpSwitchCount" key="fd" />
  141
+      <data name="transitionDownSwitchCount" key="fe" />
  142
+      <data name="transitionTime" key="ff" />
  143
+      <!--<data name="transitionIntervalsAsString" key="" />-->
  144
+      <!--<data name="transitionDetails" key="" />-->
  145
+      <data name="upSwitchReasonCounts" key="fg" />
  146
+      <data name="downSwitchReasonCounts" key="fh" />
  147
+      <!--<data name="transitionBitRates" key="" /> -->
  148
+      <data name="transitionStreamTimeSession" key="fi" />
  149
+      <data name="transitionStreamTimes" key="fj" />
  150
+    </dataMetrics>
  151
+  </playing>
  152
+  <complete eventCode="C">
  153
+    <dataMetrics>
  154
+    </dataMetrics>
  155
+  </complete>
  156
+  <error eventCode="E">
  157
+    <dataMetrics>
  158
+      <data name="errorCode" key="ca" />
  159
+      <data name="currentStreamTime" key="v" /> 
  160
+      <data name="currentClockTime" key="w" />
  161
+      <data name="hostName" key="aa"/>
  162
+    	<data name="appName" key="ab"/>
  163
+    	<data name="streamName" key="ac"/>
  164
+    	<data name="port" key="ad"/>
  165
+    	<data name="protocol" key="ae"/>
  166
+    	<data name="format" key="am"/>
  167
+    	<data name="streamUrl" key="aw"/>
  168
+    	<data name="deliveryType" key="ax"/>
  169
+      <data name="bucketLength" key="ba" />
  170
+    </dataMetrics>
  171
+  </error>
  172
+  <split>
  173
+    <dataMetrics>
  174
+      <data name="partNumber" key="za"/>
  175
+      <data name="totalParts" key="zb"/>
  176
+    </dataMetrics>
  177
+  </split>
  178
+</statistics>
  179
+</AkamaiPlayerAnalyticsConfig>
Commit_comment_tip

Tip: You can add notes to lines in a file. Hover to the left of a line to make a note

Something went wrong with that request. Please try again.