Can we use playhead tracker object instead of a html video element in case of DAI HTML5 SDK

51 views
Skip to first unread message

Pratik Kale

unread,
Nov 13, 2024, 4:58:29 AMNov 13
to Interactive Media Ads SDK
Hello,

We are working on a hybrid app for tv, where we are using google IMA HTML5 SDK inside a webview. 

In case of CSAI ads, the webview has a playhead tracker object with currentTime property.
The content is played in native layer of the app and the playhead position is updated in the webview. i.e currentTime property of the playhead tracker object is updated. 
With updating the currentTime property of the tracker object, CSAI midroll ads are correctly shown inside the webview and all the AdEvents like CONTENT_PAUSE_REQUESTED, CONTENT_RESUME_REQUESTED etc are received properly.

But in case of DAI ads, StreamManager requires a HTML video element to initialise.
new StreamManager(videoElement, adUiElement, uiSettings)

As we need to play content in the native layer, we tried passing it a video element with no src and we are setting currentTime of this video element as the content in the native layer progresses.
We are also passing the timed metadata and processing it in the webview with,
'streamManager.processMetadata('ID3', event.payload.data, event.startTime);'

With this setup, we are not able to receive events like AD_BREAK_STARTED, AD_BREAK_ENDED etc.
If we set the src property of the video element to some dummy mp4 video stream, everything works fine and we are getting all the events.

Is there a way we can use a video element with no source and set the currentTime to receive the ad events. Or is there a way we can use a tracker object instead of the video element with currentTime property and update the currentTime of the tracker object (similar to CSAI ads).

Thanks & Regards,
Pratik

IMA SDK

unread,
Nov 13, 2024, 11:54:53 AMNov 13

Hi Pratik,

Thank you for contacting the IMA SDK support team.

For further investigation, kindly provide the below details: 

  • Please confirm which TV android TV or other
  • Could you please explain more about the issue on how you are rending the ads in the webview with the help of URL or custom code
  • In which language you are creating the Hybrid app 
  • Sample project not firing adEvents AD_BREAK_STARTED, AD_BREAK_ENDED 

If the file(s) you are looking to share are less than 25mb in total you can attach them to this case on your next reply. If you are having trouble attaching your file to this case or if your file(s) are larger than 25mb, you can share your files with me by performing the following steps:

1. Navigate to

https://docs.google.com/forms/d/e/1FAIpQLSfkAiXMeYP-fw1W3Z-tT9uwmATEKO5X6S-th0gR2ezdKaaqfg/viewform?usp=pp_url&entry.400550049=IMA+SDK&entry.460850823=5004Q00002vGjkVQAS&entry.80707362=00275469

2. Fill out all fields, and attach your file(s).

3. Please reply back on this thread when you have uploaded your file(s). Please do not share this link. 

This message is in relation to case "ref:!00D1U01174p.!5004Q02vGjkV:ref" (ADR-00275469)

Thanks,
 
Google Logo IMA SDK Team


Pratik Kale

unread,
Nov 15, 2024, 5:04:01 AMNov 15
to Interactive Media Ads SDK
Hello,

  • Please confirm which TV android TV or other - it is a streaming device similar to roku / firestick. It supports app development with react native
  • Could you please explain more about the issue on how you are rending the ads in the webview with the help of URL or custom code
  •   - In the webview we have index.html with a video element like
      <video id="video"></video>
      - In js code
       videoElement = document.getElementById('video');
      - Then we are initialising stream manager
      streamManager = new google.ima.dai.api.StreamManager(videoElement, adUiElement);
      streamManager.addEventListener(
          [
            google.ima.dai.api.StreamEvent.Type.LOADED,
            google.ima.dai.api.StreamEvent.Type.ERROR,
            google.ima.dai.api.StreamEvent.Type.AD_BREAK_STARTED,
            google.ima.dai.api.StreamEvent.Type.AD_BREAK_ENDED
          ],
          onStreamEvent, false);

       -  Whenever LOADED event is triggered we get the url and we are playing that url in the native layer
       - native layer sends the progress of the video & timed metadata back to the webview
       - Whenever we get video progress from native layer we are setting the currentTime of the videoElement
        videoElement.currentTime = currentTimeFromNativeLayer;
       - whenever we receive timed metadata from native layer we are calling processMetadata 
        
    streamManager.processMetadata('ID3', data, pts);
       - Following the above we are not getting other events like AD_BREAK_STARTED, AD_BREAK_ENDED
       - If we have a video element in html with some source like below, everything works fine and we receive all the events
         <video src="http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/BigBuckBunny.mp4" id="video-internal"></video>
       - The issue is we don't want to have any source in this video element as the url received after LOADED event will be played in the native layer.
  • In which language you are creating the Hybrid app - React Native
Thanks & Regards,
Pratik


Message has been deleted

IMA SDK

unread,
Nov 15, 2024, 9:08:16 AMNov 15

Hi Pratik,

Thank you for providing the requested information. 

Please note that the IMA SDK supports these platforms. Since you are using HTML also to investigate this issue further, kindly provide the sample project to have the full visibility of your implementation.

You can provide the following details via reply privately to the author option or directly provide it to this link . 

IMA SDK

unread,
Nov 18, 2024, 10:06:49 AM (11 days ago) Nov 18
Hi Pratik,

Thank you for sharing the files. However, we haven't received the files yet. So kindly re-share the requested files.

You can provide the following details via reply privately to the author option or directly provide it to this link. 

This message is in relation to case "ref:!00D1U01174p.!5004Q02vGjkV:ref" (ADR-00275469)

Thanks,
 
Google Logo IMA SDK Team

Feedback
How was our support today?

rating1    rating2    rating3    rating4    rating5


 


IMA SDK

unread,
Nov 19, 2024, 7:58:59 AM (10 days ago) Nov 19

Hi Pratik,

Thank you for uploading the requested files.

I will check with our team regarding your query and one of my team members will reach out to you once we have an update.

IMA SDK

unread,
Nov 20, 2024, 4:46:55 PM (9 days ago) Nov 20
Hello Pratik,

This is Jackson from the IMA SDK team to help with your issue. I downloaded an played the sample app in a web environment, saw some issue with the ad UI, but did not see an issue with the current time.

It may help if you can clarify how you are getting the stream URL, since in a typical IMA DAI integration, IMA will handle he stream playback based on the stream request.

Can you clarify which TV platform you are integrating IMA with?

IMA DAI does require you pass the HTML element being used for video playback into the stream manager constructor. If that is not possible, it is likely IMA DAI does not support your specific use-case.

Please let me know if you have any additional questions.
 
This message is in relation to case "ref:!00D1U01174p.!5004Q02vGjkV:ref" (ADR-00275469)

Thanks,
 
Google Logo
Jackson Sui
IMA SDK Team


Feedback
How was our support today?

rating1    rating2    rating3    rating4    rating5
 

 



Reply all
Reply to author
Forward
0 new messages