问题描述
我看到新的JW Player 6 Enterprise失去了报告已播放秒数和Google Analytics活动百分比的能力。
有没有人开发出一种方法来生产某些东西喜欢这个?我想JW Player API和一些JavaScript可以支持这些事件。
$ b [我们很好地利用了JW Player 5中的Seconds Played和Percentage Played功能,很伤心看到它。如果有任何来自JWPlayer的人在倾听:这些事件会回来!)
我想你可以重新创建秒用onTime回调自己跟踪自己。试试这个:
$ b
var currentDuration = -1;
var currentPosition = -1;
var jw = jwplayer();
jw.onTime(function(){
var position = this.getPosition();
var duration = this.getDuration();
if((duration === currentDuration && position === currentPostion)|| duration === -1){
return;
}
currentPosition = position;
currentDuration = duration;
var file = this.getPlaylistItem()。file
return _gaq.push(['_ trackEvent','JW Player Seconds Played',file,window.location.href);
});
I see the new JW Player 6 Enterprise has lost the capability to report Seconds Played and Percentage Played as Google Analytics Events.
Has anyone developed a method to produce something like this? I imagine the JW Player API and some JavaScript could support these events.
[We made great use of the Seconds Played and Percentage Played capabilities in JW Player 5, and I'm sad to see it go. If anyone from JWPlayer is listening: it would be great to have those events back!]
I think you could recreate the seconds played tracking on your own with the onTime callback. Try this:
var currentDuration = -1;
var currentPosition = -1;
var jw = jwplayer();
jw.onTime(function() {
var position = this.getPosition();
var duration = this.getDuration();
if ((duration === currentDuration && position === currentPostion) || duration === -1 ) {
return;
}
currentPosition = position;
currentDuration = duration;
var file = this.getPlaylistItem().file
return _gaq.push(['_trackEvent', 'JW Player Seconds Played', file, window.location.href);
});
这篇关于如何获得“秒播放”和“播放百分比”来自GA中JW Player 6的事件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!