Skip to content

Commit

Permalink
Merge pull request #290 from ooyala/bugfix/PLAYER-5272
Browse files Browse the repository at this point in the history
[bugfix/PLAYER-5272]  loading spinner is displayed on IMA ads
  • Loading branch information
zelibobla authored Mar 6, 2019
2 parents 4af4fb4 + e2ad86a commit e139702
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 9 deletions.
23 changes: 16 additions & 7 deletions js/google_ima.js
Original file line number Diff line number Diff line change
Expand Up @@ -2894,13 +2894,22 @@ require("../html5-common/js/utils/utils.js");
_ima.setRequiresMutedAutoplay(false);
};

var raisePlayhead = _.bind(function(eventname, currentTime, duration)
{
notifyIfInControl(eventname,
{ "currentTime" : currentTime,
"duration" : duration,
"buffer" : 0,
"seekRange" : { "begin" : 0, "end" : 0 } });
/**
* While we can not know the value of "buffer"
* (
* for SDK, IMA representatives answer:
* > The IMA SDK for Android doesn’t support the buffer size
* )
* set it to 1 (use 1 instead of 0 to avoid the problem of displaying Spinner on the AdScreen)
* @param {String} eventname - event name
* @param {Number} currentTime - current time
* @param {Number} duration - a video duration
* @param {Number} buffer - value of buffer
* @link https://groups.google.com/forum/#!topic/ima-sdk/zRNKpKNSukM
*/
const raisePlayhead = _.bind((eventname, currentTime, duration, buffer=1) => {
const seekRange = { begin: 0, end: 0 };
notifyIfInControl(eventname, { currentTime, duration, buffer, seekRange });
}, this);
};

Expand Down
4 changes: 2 additions & 2 deletions test/unit-tests/ima_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -1835,7 +1835,7 @@ describe('ad_manager_ima', function()
{
"currentTime" : CURRENT_TIME,
"duration" : DURATION,
"buffer" : 0,
"buffer" : 1,
"seekRange" :
{
"begin" : 0, "end" : 0
Expand All @@ -1856,7 +1856,7 @@ describe('ad_manager_ima', function()
{
"currentTime" : CURRENT_TIME,
"duration" : DURATION,
"buffer" : 0,
"buffer" : 1,
"seekRange" :
{
"begin" : 0, "end" : 0
Expand Down

0 comments on commit e139702

Please sign in to comment.