On Mon, Oct 21, 2013 at 3:50 PM, pajato1 <notifications@github.com> wrote:

> In
> AndroidNativePlayerSampleApp/src/main/java/com/brightcove/android/sampleapp/MainActivity.java:
>
> > +            public void processEvent(Event event) {
> > +                ArrayList<AdsRequest> adsRequests = new ArrayList<AdsRequest>(googleAds.length);
> > +
> > +                AdDisplayContainer container = sdkFactory.createAdDisplayContainer();
> > +                container.setPlayer(googleIMAComponent.getVideoAdPlayer());
> > +                container.setAdContainer(bcVideoView);
> > +
> > +                ArrayList<CompanionAdSlot> companionAdSlots = new ArrayList<CompanionAdSlot>();
> > +                CompanionAdSlot companionAdSlot = sdkFactory.createCompanionAdSlot();
> > +                ViewGroup adFrame = (ViewGroup) findViewById(R.id.ad_frame);
> > +                companionAdSlot.setContainer(adFrame);
> > +                companionAdSlot.setSize(adFrame.getWidth(), adFrame.getHeight());
> > +                companionAdSlots.add(companionAdSlot);
> > +                container.setCompanionSlots(companionAdSlots);
> > +
> > +                for (int i = 0; i < googleAds.length; i++) {
>
> This shows how to play multiple ads in the same slot, in other words back
> to back.
>

I annotated the code with comments making this point and further describing
the intent.  fwiw, I generally try to concoct a useful, non-obvious comment
for every 6-10 lines of code.  Not always easy, so I will put something
down in the hope better minds will improve the comment.  To me comments are
the "spec" and the code is the matching implementation.  The reader gains
benefit by being able to "prove", even if only in his/her own mind, that
the spec and implementation are consistent.  That is the value, IMHO, of
commenting profusely: it establishes a sense of correctness for the code.
 This practice/philosophy comes from my education at Wang Institute with
provably correct software, albeit way more informal.  Clearly it is hard to
do well but with practice one improves.

-dad