getGL_(canvas) {
    if (!canvas) {
      return null;
    }
    // The user interface is not intended for devices that are controlled with
    // a remote control, and WebGL may run slowly on these devices.
    const device = shaka.device.DeviceFactory.getDevice();
    const deviceType = device.getDeviceType();
    if (deviceType == shaka.device.IDevice.DeviceType.TV ||
        deviceType == shaka.device.IDevice.DeviceType.CONSOLE ||
        deviceType == shaka.device.IDevice.DeviceType.CAST) {
      return null;
    }
    const webglContexts = [
      'webgl2',
      'webgl',
    ];
    for (const webgl of webglContexts) {
      const gl = canvas.getContext(webgl);
      if (gl) {
        return /** @type {!WebGLRenderingContext} */(gl);
      }
    }
    return null;
  }
@param {?HTMLCanvasElement} canvas
@return {?WebGLRenderingContext}
@private