Skip to content

VideoPlayerController.networkUrl not sending HTTP headers correctly #21

@KrohnMi

Description

@KrohnMi

When using the VideoPlayerController.networkUrl constructor with custom HTTP headers, the headers are not being sent correctly to the server. Despite providing the necessary headers, the server does not receive the header information as expected.

Steps to Reproduce:

  1. Create a headers map with the required HTTP headers, including 'X-API_KEY' and 'User-Agent'.
final headers = {
   'X-API_KEY': 'HERE YOUR TEST KEY',
   'User-Agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/115.0.0.0 Safari/537.36',
};
  1. Initialize a VideoPlayerController instance using the VideoPlayerController.networkUrl constructor, passing in the video URL and the custom headers.
final videoPlayerController = VideoPlayerController.networkUrl(
   Uri.parse('https://test-streams.mux.dev/x36xhzz/x36xhzz.m3u8'),
   httpHeaders: headers,
);

await videoPlayerController.initialize()

Observe that the server does not receive the expected header information.

Expected Behavior:

The VideoPlayerController.networkUrl constructor should send the specified HTTP headers ('X-API_KEY' and 'User-Agent') to the server along with the video request. The server should be able to correctly receive and process the header information.

Actual Behavior:

The server does not receive the specified HTTP headers, even though they are provided through the VideoPlayerController.networkUrl constructor. This issue prevents proper communication between the client and the server, potentially causing unintended behavior or access restrictions.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions