getCaptionsFromPackets = (service, ...packets) => {
    const allCaptions = [];
    for (const packet of packets) {
      while (packet.hasMoreData()) {
        const captions = service.handleCea708ControlCode(packet);
        if (captions) {
          allCaptions.push(...captions);
        }
      }
    }
    return allCaptions;
  }
Takes in a CEA-708 service and array of 708 packets with control codes,
and returns all the captions inside of them, using the service to decode.
@param {!shaka.cea.Cea708Service} service
@param {...!shaka.cea.DtvccPacket} packets
@return {!Array<shaka.extern.ICaptionDecoder.ClosedCaption>}