prebid / prebid-mobile-android

Prebid Mobile SDK for Android applications
Apache License 2.0
57 stars 82 forks source link

Video format support #146

Closed bszekely1 closed 4 years ago

bszekely1 commented 5 years ago

Type of issue

Intent to implement

Description

The goal of this intent to implement is to provide video format support to the Prebid SDK product. The initial build is intended to integrate into Google Ad Manager (GAM) as GAM provides an easy VAST API (via the Mobile Ads SDK) for processing and handling VAST ads. Future iterations may include other ad servers or rendering without an ad server for publishers who do not have a direct sales team that don't require an ad server.

SDK Public API

This section will cover the public facing API in the SDK to set video specific features:

Note: The default player behavior will be autoplay sound off, non-skippable in the first iteration. The next iteration will include the option for publishers to define these fields in the stored request, where PBS will echo back to the SDK for the device player to signal on playback method and skippability. Both fields will be set by a private field.

Video Player

VAST handler:

The media player will default to autoplay on, sound off, with a UI feature for the user to enable sounds as they wish.

The supported video attributes intrinsic to the video player are defined by the limitations for the respective video player of each platform. The statically defined video attributes and values from the SDK to Prebid Server are below:

"video": {
        "mimes": ["video/mp4"],
            "startdelay":0,
            "protocols":[7],
            "playbackmethod":2
            }

Stored Requests

The following video fields will be entered in the stored request specific to video:

Ad Server Integration

Prebid SDK will make a request for a VAST ad using the Google IMA SDK, triggering a VAST Prebid Line item as a standard Prebid video integration

Fields for the GAM API

Prebid SDK <> Prebid Server

This section will cover communication between Prebid SDK and Prebid Server. Since the video solution for Prebid SDK will provide the

Request

Outstream

{
    "test":0,
    "id": "da8c49ae-9d88-4824-a565-9ed35fd7dd20",
    "source": {
        "tid": ""
    },
    "imp": [{
        "id": "PrebidMobile",
        "secure": 1,
        "video":{
            "w": "640",
            "h": "480",
                        "mimes": ["video/mp4"],
                        "startdelay":0,
                        "protocols":[7],
                        "playbackmethod":2,
                        "placement":4
        },
        "ext": {
            "prebid": {
                "storedrequest": {
                    "id": "1234"
                }
            }
        }
    }],
    "device": {
        "make": "samsung",
        "model": "SM-G935U",
        "ua": "Mozilla\/5.0 (Linux; Android 8.0.0; SM-G935U Build\/R16NW; wv) AppleWebKit\/537.36 (KHTML, like Gecko) Version\/4.0 Chrome\/71.0.3578.99 Mobile Safari\/537.36",
        "lmt": 0,
        "ifa": "d01d3624-10f7-4943-9362-704fee1a348a",
        "os": "android",
        "osv": "26",
        "language": "en",
        "w": 360,
        "h": 616,
        "pxratio": 3,
        "connectiontype": 1
    },
    "app": {
        "bundle": "org.prebid.mobile.api1demo",
        "ver": "1.1",
        "name": "API1.0Demo",
        "publisher": {
            "id": "1234"
        },
        "ext": {
            "prebid": {
                "source": "prebid-mobile",
                "version": "1.1"
            }
        }
    },
    "user": {
        "gender": "O"
    },
    "regs": {
        "ext": {}
    },
    "ext": {
        "prebid": {
            "cache": {
                "vastxml": {
                    "returnCreative" : "false"
                }
            },
            "storedrequest": {
                "id": "xxxx"
            },
            "targeting": {
                "includewinners": true,
                "includebidderkeys": true
            }
        }
    }
}

Insterstial The main differences between the standard outstream and interstitial is the interstial flag in each bid object.

    "imp": [{
        "id": "PrebidMobile",
        "secure": 1,
        "instl": 1,
        "video":{
            "w": "640",
            "h": "480",
                        "placement":5  //this will always default to 5 for interstitial
        },
        "ext": {
            "prebid": {
                "storedrequest": {
                    "id": "1234"
                }
            }
        }
    }]

Response

{
    "id": "da8c49ae-9d88-4824-a565-9ed35fd7dd20",
    "seatbid": [
        {
            "bid": [
                {
                    "id": "3df31dd5-56cd-4c7c-aa8a-41e378d05643",
                    "impid": "PrebidMobile",
                    "price": 5.150000095367432,
                    "nurl": "nurl_pixel",
                    "crid": "4244134",
                    "ext": {
                        "prebid": {
                            "type": "video",
                            "targeting": {
                                "hb_pb_rubicon": "5.10",
                                "hb_uuid_rubicon": "8c42d244-7b65-468c-8575-23f09dae66b1",
                                "hb_env_rubicon": "mobile-app",
                                "hb_bidder_rubicon": "rubicon",
                                "hb_cache_path_rubicon": "/cache",
                                "hb_cache_host_rubicon": "prebid-cache.rubiconproject.com"
                            },
                            "cache": {
                                "vastXml": {
                                    "url": "https://prebid-cache.rubiconproject.com/cache?uuid=8c42d244-7b65-468c-8575-23f09dae66b1",
                                    "cacheId": "8c42d244-7b65-468c-8575-23f09dae66b1"
                                }
                            },
                            "events": {
                                "win": "win_url",
                                "imp": "imp_url"
                            }
                        },
                        "bidder": {
                            "rp": {
                                "mime": "application/javascript",
                                "size_id": 201
                            }
                        }
                    }
                }
            ],
            "seat": "rubicon",
            "group": 0
        }
    ],
    "cur": "USD",
    "ext": {
        "responsetimemillis": {
            "cache": 55,
            "rubicon": 80
        },
        "tmaxrequest": 900
    }
}

Platform details

Support for Android

Other information

Video supported will be broken out into a new module in the build process for the SDK defined in the modularization issue 239.

root-ansh commented 4 years ago

Hi. I am currently working on a video based app with ads and came across prebid.org and then here. I am currently using ima ads and from what i know prebid is a way to make bidding possible for every consecutive ad. I was thinking of using prebid, but from this issue, i am guessing that using prebid for bidding of runtime vast ads is currently not possible. Is this the case?

If so, i would like to mention a few things and make some requests. Please make this library flexible enough to allow usage of other video players and vast handlers. VideoView and Mediaplayer in android are very outdated method for playing videos, so please give us the flexiblity to use other players.

Similarly many people these days are not using Ima sdk or handling most of the components of Ima sdk by themselves, so it would be difficult if the core components of IMA are tightly coupled with this library.

That's all , Thank you very much for reading this and making this awesome library!

bszekely1 commented 4 years ago

Hi Ansh, we are always welcome to feedback. This is our initial iteration of many into our video integration via Prebid SDK. Additionally this is the fist time we as in Prebid are providing a video renderer (i.e. video player) to facilitate easier integrations into video, especially for publishers who do not have video inventory.

I will reach out to you privately to discuss your feedback.