Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Changed how view counts work #15

Merged
merged 2 commits into from
Oct 4, 2014
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions app/assets/scripts/app/player-controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -123,8 +123,9 @@ define([
var embedData = null;
var playerUris = null;
var previousPlayerUris = null;
var currentQualityId = null
var previousQualityId = null
var currentQualityId = null;
var previousQualityId = null;
var viewCountRegistered = false;


$(qualitiesHandler).on("chosenQualityChanged", function() {
Expand Down Expand Up @@ -188,7 +189,10 @@ define([
playerComponent = new PlayerComponent(data.coverUri, responsive);
$(self).triggerHandler("playerComponentElAvailable");
$(playerComponent).on("play", function() {
registerViewCount();
if (!viewCountRegistered) {
viewCountRegistered = true;
registerViewCount();
}
});
}

Expand Down
2 changes: 1 addition & 1 deletion app/config/custom.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,5 @@
"embed_player_register_view_count_base_uri" => URL::to("/") . "/player/register-view",
"embed_player_register_like_base_uri" => URL::to("/") . "/player/register-like",
// time in minutes that must pass between views on the same item being registered
"interval_between_registering_view_counts" => 180
"interval_between_registering_view_counts" => 5
);