googleads / videojs-ima

IMA SDK Plugin for Video.js
Apache License 2.0
450 stars 284 forks source link

hidden metadata textTrack not triggering "cuechange" events for Android WebView #817

Closed sunilkumarjena21 closed 5 years ago

sunilkumarjena21 commented 5 years ago

Description When setting a 'metadata' text track to 'hidden' mode and adding a cuechange event, the events are not being fired on Android WebView.Same code perfectly working on Chrome :)

Steps to reproduce Explain in detail the exact steps necessary to reproduce the issue. 1.set the captions track to hidden 2.add cuechange event listener 3.send some 'ad-cues' events in HLS format.

Results Expected cuechange event should be trigger when encounter the 'ad-cues'

Actual event is not being triggered on Android WebView on android device, but works perfectly fine on Desktop Chrome browser.

Error output cueChange event not triggering at all in mobile device(tested on Android WebView)

Additional Information versions videojs 5.16.0 what version of videojs does this occur with? 5.16.0

browsers Android WebView what browser are affected? Android WebView

OSes Android,IOS what platforms (operating systems and devices) are affected? Android,IOS

plugins

are any videojs plugins being used on the page? If so, please list them below. No.

Quick response will be highly appreciated 👍 Thanks in advance

Kiro705 commented 5 years ago

Hello,

We're taking a look at what's causing the cuechange event not to fire. Would you be able to attach any logs of the error that could help us debug the issue?

As a note, WebView is not one of our supported browsers for videojs-ima, but we will continue to investigate the issue.

sunilkumarjena21 commented 5 years ago

Hello @Kiro705 , Thanks for your response :)

Log:-If you run the code given in the link below,you can see the Advert position:length--0 or length--1 .. But its not getting printed when you run the same code on webview on Android..

Reason: track.addEventListener('cuechange', cueChangeHandler); This Listener is not getting called either on Android WebView.

Thanks in advance!

Kiro705 commented 5 years ago

Hi @sunilkumarjena21,

Have you considered using the Android IMA SDK or the Android ExoPlayer extension with IMA. Those are two ways of using IMA with Android that we do support.

At the moment WebView is not one of the supported browsers for the html5 IMA SDK.

sunilkumarjena21 commented 5 years ago

Thanks @Kiro705 , Reason for choosing the VideoJs player is : We just wanted to use a player which is supported throughout the platform(Web,Android,iOS etc).So completed 80% of task around Android after completing web part.

Now come to know that as VideoJs-IMA It is not going to support in Android & iOS platform.Its obiously a setack for us. Becasue lot of hard work would going to be wasted.

Just a final question:- What i understood Videojs-ima is not build for Mobile platforms(Android & iOS)? If yes how VideoJS-IMA supports mobile platforms.(Through Cordova or framework like ionic) or what?

Second Question:-Are Android IMA SDK or the Android ExoPlayer extension with IMA supports inserting mid-roll video ads ? Similar to VideoJS-IMA where 'metadata' can be modified in the stream to insert 'ad-cues' to support DAI (Dynamic ad insertion) in live stream? If Yes which one is better for custom ad insertion in live stream(Android IMA SDK or the Android ExoPlayer extension with IMA supports)?

Thanks in advance!

Kiro705 commented 5 years ago

Hi @sunilkumarjena21,

I am looking into your specific use case with my team, but I wanted to ask if you had considered using the DAI IMA SDK for Android and iOS, with an Ad Manager 360 account?

Take a look here (https://developers.google.com/interactive-media-ads/docs/sdks/android/dai/) if it looks like it would solve the issue.

Alternatively, you would have to manually parse the steam's metadata, then pause the stream to run ads using the client side IMA SDK for Android.

sunilkumarjena21 commented 5 years ago

Hi Kiro , Thanks for your supporting hand.Sorry for coming late on response from my side.

I might failed to explain our requirement correctly to you.

Workflow of existing Browser platform & Mobile Platform:-

  1. The live stream used by IMA DAI BasicExample is different than VideoJs-IMA Workable stream
  2. In-case of Google's live stream URL the DFP adTag Urls is by-default configured inside the Playlistbut but incase of VideoJs-IMA Workable stream the configuration expects those URL should be served outside of the HLS playlist.

Our Requirement:- Just wanted to know how to use the stream(used in VideoJs-IMA) in IMA DAI BasicExample or similar Demo for Mobile platforms(Android & iOS)?

Thanks in advance for your kind response :)

Regards

Sunil

Kiro705 commented 5 years ago

Hi Sunil,

The DAI IMA SDK supports server side ad-insertion through the use of an Manager 360 account. In the account you can create your video stream with ads, and generate the corresponding Content Source ID and Video ID used in the IMA DAI BasicExample.

However, DAI does not support client side insertion of ads into a video stream.

The videojs-ima plugin is designed to support client side ad management through VAST tag ad playing and not server side ad-insertion.

Please let me know if you have farther questions or concerns.

Thanks, Jackson IMA SDK DevRel

sunilkumarjena21 commented 5 years ago

Hi Kiro  ,

Thanks for your quick response.

Can you please guide me:- how run ads using the client side IMA SDK for Android. I want to use this stream(used in VideoJs-IMA) in client side IMA SDK for Android. Any demo or example link would be really helpful.

Thanks in advance! 

Kiro705 commented 5 years ago

Hi Sunil,

The set up you are looking for would involve setting up a way to determine when to pause the video stream, possibly based on metadata managed by you from the stream. Ad playback would then occur during those stream breaks.

To be clear, this is not a method directly supported by either the client side or server side SDK, and would involve considerable setup on your teams part.

Thanks, Jackson IMA SDK DevRel

sunilkumarjena21 commented 5 years ago

HI Kiro,

Thanks for your quick response:)

Description Registered ID3 events not fired in any of the sample given by Android SDK. Description Registered ID3 events not fired in any of the sample given by Android SDK. i.e the below @overriden method not being triggered when meeting to cuechange event. The events are not being fired on despite the URL(HLS playlist) contains the #EXT-X-CUE-IN & #EXT-X-CUE-OUT tags.Same URL(HLS playlist) working perfectly in VIdeoJS IMA plugin on Chrome :) Workable VideoJS-IMA-URL:-https://adinsertplayer.s3.ap-south-1.amazonaws.com/Demoplayer2.html Steps to reproduce 1.set this URL(https://adinsertplayer.s3.ap-south-1.amazonaws.com/sampleoutput0302_modified_1_Live.m3u8) as StreamUrl. 2.Go to SampleVideoPlayer.java 3.Go to the below method to dubug & check if "onMetadata(Metadata metadata)" mehthod is being triggered or not. Code Snippet of complete method:-

    // Register for ID3 events.
    mPlayer.addMetadataOutput(new MetadataOutput() {
        @Override
        public void onMetadata(Metadata metadata) {
            for (int i = 0; i < metadata.length(); i++) {
                Metadata.Entry entry = metadata.get(i);
                if (entry instanceof TextInformationFrame) {
                    TextInformationFrame textFrame = (TextInformationFrame) entry;
                    if ("TXXX".equals(textFrame.id)) {
                        Log.d(LOG_TAG, "Received user text: " + textFrame.value);
                        if (mPlayerCallback != null) {
                            mPlayerCallback.onUserTextReceived(textFrame.value);
                        }
                    }
                }
            }
        }
    });

Results Expected:- "onMetadata(Metadata metadata)" event should trigger when encounter the #EXT-X-CUE-IN & #EXT-X-CUE-OUT tags in the playlist as similar to VideoJs-IMA sample. Actual:- event is not being triggered on this android IMA DAI demo app, working perfectly in VIdeoJS IMA plugin on Chrome desktop browser. Error output "onMetadata(Metadata metadata)" event should trigger when encounter the #EXT-X-CUE-IN & #EXT-X-CUE-OUT tags in the playlist at all in android device(tested on Android Samsung s9) Quick response will be highly appreciated
Thanks in advance

Kiro705 commented 5 years ago

Yes, this is expected behavior as the DAI is expecting a Content Source ID and Video ID as demonstrated in the in the IMA DAI BasicExample.

From my understanding, the implementation you are looking for is not one supported in our demos or documentation. Please refer to the documentation for the intended use of the server side IMA SDK for Android.