Giter VIP home page Giter VIP logo

video_player_web_hls's Introduction

video_player_web_hls

Version

Supports hls on chrome and other browsers.

Usage

...
dependencies:
  ...
  video_player_web_hls: ^0.1.1
  video_player: ^0.10.10

  ...

Add

 <script src="https://cdn.jsdelivr.net/npm/hls.js@latest"  type="application/javascript"></script>

in index.html above

 <script src="main.dart.js" type="application/javascript"></script>

dart:io

The Web platform does not suppport dart:io, so attempts to create a VideoPlayerController.file will throw an UnimplementedError.

Autoplay

Playing videos without prior interaction with the site might be prohibited by the browser and lead to runtime errors. See also: https://goo.gl/xX8pDD.

Supported Formats

Different web browsers support different sets of video codecs.

Video codecs?

Check MDN's Web video codec guide to learn more about the pros and cons of each video codec.

What codecs are supported?

Visit caniuse.com: 'video format' for a breakdown of which browsers support what codecs. You can customize charts there for the users of your particular website(s).

Here's an abridged version of the data from caniuse, for a Global audience:

MPEG-4/H.264

Data on Global support for the MPEG-4/H.264 video format

WebM

Data on Global support for the WebM video format

Ogg/Theora

Data on Global support for the Ogg/Theora video format

AV1

Data on Global support for the AV1 video format

HEVC/H.265

Data on Global support for the HEVC/H.265 video format

Example

import 'package:video_player/video_player.dart';
import 'package:flutter/material.dart';

void main() => runApp(VideoApp());

class VideoApp extends StatefulWidget {
  @override
  _VideoAppState createState() => _VideoAppState();
}

class _VideoAppState extends State<VideoApp> {
  VideoPlayerController _controller;

  @override
  void initState() {
    super.initState();
    _controller = VideoPlayerController.network(
        'https://test-streams.mux.dev/x36xhzz/x36xhzz.m3u8')
      ..initialize().then((_) {
        // Ensure the first frame is shown after the video is initialized, even before the play button has been pressed.
        setState(() {});
      });
  }

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Video Demo',
      home: Scaffold(
        body: Center(
          child: _controller.value.initialized
              ? AspectRatio(
                  aspectRatio: _controller.value.aspectRatio,
                  child: VideoPlayer(_controller),
                )
              : Container(),
        ),
        floatingActionButton: FloatingActionButton(
          onPressed: () {
            setState(() {
              _controller.value.isPlaying
                  ? _controller.pause()
                  : _controller.play();
            });
          },
          child: Icon(
            _controller.value.isPlaying ? Icons.pause : Icons.play_arrow,
          ),
        ),
      ),
    );
  }

  @override
  void dispose() {
    super.dispose();
    _controller.dispose();
  }
}

video_player_web_hls's People

Contributors

abdelaziz-mahdy avatar agent3bood avatar atrancandoris avatar balvinderg avatar balvinderz avatar dkrutskikh avatar icefirewang avatar limbou avatar mrinaljain avatar nitn3lav avatar sese-schneider avatar wreppun avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

video_player_web_hls's Issues

Example not playing on mac

It opens but when pressing play its a blank white screen.
web and ios works.

I also upgraded the example before and after for the new null safety, but did not help for mac.


flutter run -d macos
Launching lib/main.dart on macOS in debug mode...
Running pod install...                                              3.5s
Building macOS application...                                           
[ERROR:flutter/lib/ui/ui_dart_state.cc(186)] Unhandled Exception: PlatformException(channel-error, Unable to establish connection on channel., null, null)
#0      VideoPlayerApi.initialize (package:video_player_platform_interface/messages.dart:149:7)
<asynchronous suspension>                                               
                                                                        
[ERROR:flutter/lib/ui/ui_dart_state.cc(186)] Unhandled Exception: PlatformException(channel-error, Unable to establish connection on channel., null, null)
#0      VideoPlayerApi.create (package:video_player_platform_interface/messages.dart:174:7)
<asynchronous suspension>                                               
#1      MethodChannelVideoPlayer.create (package:video_player_platform_interface/method_channel_video_player.dart:46:31)
<asynchronous suspension>                                               
#2      VideoPlayerController.initialize (package:video_player/video_player.dart:292:19)
<asynchronous suspension>                                               
#3      _VideoAppState.initState.<anonymous closure> (package:example/main.dart)
<asynchronous suspension>                                               
                                                                        
Syncing files to device macOS...                                 1,279ms

Flutter run key commands.
r Hot reload. πŸ”₯πŸ”₯πŸ”₯
R Hot restart.
h Repeat this help message.
d Detach (terminate "flutter run" but leave application running).
c Clear the screen
q Quit (terminate the application on the device).
An Observatory debugger and profiler on macOS is available at:
http://127.0.0.1:60276/Bhykl2izbxE=/

Flutter DevTools, a Flutter debugger and profiler, on macOS is available at:
http://127.0.0.1:9108?uri=http%3A%2F%2F127.0.0.1%3A60276%2FBhykl2izbxE%3D%2F

πŸ’ͺ Running with sound null safety πŸ’ͺ


flutter doctor
Doctor summary (to see all details, run flutter doctor -v):
[βœ“] Flutter (Channel beta, 2.0.1, on macOS 11.2.2 20D80 darwin-x64, locale en-DE)
[βœ—] Android toolchain - develop for Android devices
    βœ— Unable to locate Android SDK.
      Install Android Studio from: https://developer.android.com/studio/index.html
      On first launch it will assist you in installing the Android SDK components.
      (or visit https://flutter.dev/docs/get-started/install/macos#android-setup for detailed
      instructions).
      If the Android SDK has been installed to a custom location, please use
      `flutter config --android-sdk` to update to that location.

[βœ“] Xcode - develop for iOS and macOS
[βœ“] Chrome - develop for the web
[!] Android Studio (not installed)
[βœ“] VS Code (version 1.54.1)
[βœ“] Connected device (3 available)

Flutter Web: video_player_web videos are not playing on Iphone Safari browser

I am using video_player: ^2.5.1 and video_player_web_hls: ^1.0.0+1 and videos are not playing on iphone 13 mit iOS 16.1 Safari browser, but on all other platforms.

The error is "The request is not allowed by the user agent or the platform in the current context, possibly because the user denied permission"

[video_player_web_hls] Refused to set unsafe header "Cookie"

I am using the video_player_web_hls on top of flick_video_player to play .m3u8 videos in my flutter web app. the plugin works fine for normal .m3u8 URLs but when I am trying to implement signed cookies for web and pass cookies in header. I get the following error which says Refused to set unsafe header "Cookie"
Screenshot 2021-09-10 at 1 55 26 PM

Can you please help me out if its something wrong implemented from my side or its problem from the plugin side.

Following is my sudo code examples which I have tried

  1. Example 1

     `String cookie = "CloudFront-Policy=$cloudFrontPolicy" + ";CloudFront-Signature=$loudFrontSignature" +
           ";CloudFront-Key-Pair-Id=$cloudFrontKeyPairId";
    
       httpHeaders = {
         "useCookie": "true",
         "Cookie": cookie,
       };
       
       playerController = VideoPlayerController.network(playUrl,
         httpHeaders: httpHeaders,
      );`
    
  2. Example 2

       `httpHeaders = {
          "useCookie": "true",
         "CloudFront-Policy": "${_cookieDetails.cloudFrontPolicy}",
         "CloudFront-Signature": "${_cookieDetails.cloudFrontSignature}",
         "CloudFront-Key-Pair-Id": "${_cookieDetails.cloudFrontKeyPairId}"
       };
       
       playerController = VideoPlayerController.network(playUrl,
         httpHeaders: httpHeaders,
      );`
    

Hey please send me a way to say thank you!

I looked in the readme for some way to pay you for doing this. Im very thankful i spent all day yesterday trying to figure this exact issue out and you have already solved it! Thank you so much for making this!

Player not displayed when inside a Dialog or ModalBottomSheet

I have no issue to display the VideoPlayer in a Web page.

When I tried to display the same player inside a Modal dialog (with showDialog) or from an ActionSheet (with showModalBottomSheet) the video is not displayed nor played.

For information the controller is corrected initialized (I get the video duration)

Headers not working

I'm trying to pass the headers when playing m3u8 videos. Unfortunately, it isn't working somehow. Please refer to the screenshots.

My Code being

 _videoPlayerController =
              VideoPlayerController.network(videoUrl, httpHeaders: {
        'Cookie': "Cookies dummy string",
        'useCookie': "true",
        'useCookies': "true",
      })

Screenshot 2022-10-31 at 5 31 46 PM

Uncaught InternalError: too much recursion in hls.js

Hi!

We encountered a bug where the videos don't load fully in the web version of our app. They load some of the video and stop loading after that. The videos are HLS streams from Vimeo. In the browser console it says "Uncaught InternalError: too much recursion [hls.js@1:1:368422]". This error only occurs in the web version, in Android and iOS the videos work fine.

Do you think this error is happening because of something in the hls.js side, or could it be something from this plugin? Would love to find a solution for this, otherwise the plugin has worked well for us, but now suddenly we can't get the videos working properly.

WEB - Azure URL links are different

I have gone through the example link an everything went fine. I have created a stream in Azure services and I have been given several options but none of them are suitable to the example in hand. I'm not an expert in video streaming but was wondering how this could be achieved.

hls : https://gnmservicerecording-usea.streaming.media.azure.net/f1b83d9e-e09f-4bc8-a6bb-21b232ea058b/174939a2-0ac8-405f-b0ef-b34429c2bac3.ism/manifest(format=m3u8-aapl)

DASH: https://gnmservicerecording-usea.streaming.media.azure.net/f1b83d9e-e09f-4bc8-a6bb-21b232ea058b/174939a2-0ac8-405f-b0ef-b34429c2bac3.ism/manifest(format=mpd-time-csf)

smoothstreaming: https://gnmservicerecording-usea.streaming.media.azure.net/f1b83d9e-e09f-4bc8-a6bb-21b232ea058b/174939a2-0ac8-405f-b0ef-b34429c2bac3.ism/manifest

None of them are working and I'm getting this error

image

I have also added the script tag before the head in the index.html.
If I use the smoothStreaming url in this link I can see that the format it is supported
https://ampdemo.azureedge.net/?url=https%3A%2F%2Fgnmservicerecording-usea.streaming.media.azure.net%2Ff1b83d9e-e09f-4bc8-a6bb-21b232ea058b%2F174939a2-0ac8-405f-b0ef-b34429c2bac3.ism%2Fmanifest

Any advice or help will be much appreciated.

Update to work with latest version of hls.js

PlatformException(MEDIA_ERR_NETWORK, mediaError, fragParsingError, null)

I started getting this error all of a sudden from yesterday. Not quite sure but I think it's related to the latest upgrade of hls.js as the same videos were getting played prior to that.

Only audio is being played on iOS safari & chrome

Im trying to play .hls video on a flutter web project. It is working on every other browser except for safari on iOS. Only audio is being played, while the video player displays nothing. Seems like this issue. Are there any workarounds to make it work?

Doctor summary (to see all details, run flutter doctor -v):
[βœ“] Flutter (Channel unknown, 3.0.5, on Ubuntu 22.04 LTS 5.15.0-1020-aws, locale en_US.UTF-8)
[βœ“] Android toolchain - develop for Android devices (Android SDK version 30.0.2)
[βœ—] Chrome - develop for the web (Cannot find Chrome executable at google-chrome)
! Cannot find Chrome. Try setting CHROME_EXECUTABLE to a Chrome executable.
[☠] Linux toolchain - develop for Linux desktop (the doctor check crashed)
βœ— Due to an error, the doctor check did not complete. If the error message below is not helpful, please let us know about this issue at https://github.com/flutter/flutter/issues.
βœ— ProcessException: Failed to find "pkg-config" in the search path.
Command: pkg-config
[!] Android Studio (not installed)
[βœ“] Connected device (1 available)
[βœ“] HTTP Host Availability

Tried with video_player_web_hls 0.1.11+4

Video not showing up in release.

Hi!

In debug mode everything works as expected.
Once the website is deployed the video doesn't show and only a white square appears.

Happens on both Safari and Chrome.

[Bug] Video does not play on iOS Safari

To reproduce:

  • Build and deploy the example
  • Open up an iPhone simulator
  • Open safari and navigate to the example
  • Hit play

Current behavior:

  • Nothing happens

Expected behavior:

  • The video plays

I'll have a PR ready for this shortly.

VideoPlayerController loses state when current hls segment has not downloaded yet

Sometimes, especially on slow connections(manipulated from network panel on developer tools), the VideoPlayerController loses its state, the video plays, but its state cannot be controlled. If I use VideoProgressIndicator it falls into busy mode and if I try to pause and play the video then it starts from beginning. If I use Chewie it shows a white warning icon. The console output shows ''No further diagnostic information can be determined or provided"

full screen issue

i cannot use full screen on web

Height of Platform View type: [videoPlayer-1] may not be set. Defaulting to `height: 100%`.
Set `style.height` to any appropriate value to stop this message.
Width of Platform View type: [videoPlayer-1] may not be set. Defaulting to `width: 100%`.
Set `style.width` to any appropriate value to stop this message.

some times reported

Uncaught RangeError: Maximum call stack size exceeded

Guys im getting this error in chrome..

Computer: Mac Studio(2022), Chip Apple M1 Max
OS: MacOS Monterey
Version: 12.3.1

Chrome Version: Version 116.0.5845.140 (Official Build) (arm64) hls.js@latest:1 Uncaught RangeError: Maximum call stack size exceeded at e.trigger (hls.js@latest:1:368422) at e.trigger (hls.js@latest:1:368637) at e.trigger (hls.js@latest:1:368637) at e.trigger (hls.js@latest:1:368637) at e.trigger (hls.js@latest:1:368637) at e.trigger (hls.js@latest:1:368637) at e.trigger (hls.js@latest:1:368637) at e.trigger (hls.js@latest:1:368637) at e.trigger (hls.js@latest:1:368637) at e.trigger (hls.js@latest:1:368637)

Mobile chromium browser VideoController value error

First of all, thank you for creating such a wonderful library. However, a problem occurred during use.

problem

VideoControllerValue is not initialized in the Mobile Chromium browser.
image

Firefox mobile is okay, but with Safari, Edge, Chrome, and Samsung Internet browsers occurs problem. Only with hls video.

code

import 'package:flutter/material.dart';
import 'package:video_player/video_player.dart';

void main() {
  runApp(const MyApp());
}

class MyApp extends StatelessWidget {
  const MyApp({super.key});

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Flutter Demo',
      theme: ThemeData(
        primarySwatch: Colors.blue,
      ),
      home: const MyHomePage(),
    );
  }
}

class MyHomePage extends StatefulWidget {
  const MyHomePage({Key? key}) : super(key: key);

  @override
  State<MyHomePage> createState() => _MyHomePageState();
}

class _MyHomePageState extends State<MyHomePage> {
  late final VideoPlayerController videoPlayerController;

  @override
  void initState() {
    super.initState();
    videoPlayerController = VideoPlayerController.network(
      'https://test-streams.mux.dev/x36xhzz/x36xhzz.m3u8',
      formatHint: VideoFormat.hls,
    )..initialize().then((_) {
        // videoPlayerController.play();
        videoPlayerController.setLooping(true);
      });
    videoPlayerController.addListener(() {
      debugPrint(videoPlayerController.value.toString());
    });
  }

  @override
  void dispose() {
    videoPlayerController.dispose();
    super.dispose();
  }

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      body: Center(
        child: videoPlayerController.value.isInitialized
            ? AspectRatio(
                aspectRatio: videoPlayerController.value.aspectRatio,
                child: VideoPlayer(videoPlayerController),
              )
            : Container(),
      ),
      floatingActionButton: FloatingActionButton(
        onPressed: () {
          setState(() {
            videoPlayerController.value.isPlaying
                ? videoPlayerController.pause()
                : videoPlayerController.play();
          });
        },
        child: Icon(
          videoPlayerController.value.isPlaying
              ? Icons.pause
              : Icons.play_arrow,
        ),
      ),
    );
  }
}

flutter doctor -v

[βœ“] Flutter (Channel stable, 3.3.0, on macOS 12.6 21G115 darwin-arm, locale ko-KR)
    β€’ Flutter version 3.3.0 on channel stable at /Users/bluejoy/development/sdk/flutter
    β€’ Upstream repository https://github.com/flutter/flutter.git
    β€’ Framework revision ffccd96b62 (3달 μ „), 2022-08-29 17:28:57 -0700
    β€’ Engine revision 5e9e0e0aa8
    β€’ Dart version 2.18.0
    β€’ DevTools version 2.15.0

[βœ“] Android toolchain - develop for Android devices (Android SDK version 33.0.0)
    β€’ Android SDK at /Users/bluejoy/Library/Android/sdk
    β€’ Platform android-33, build-tools 33.0.0
    β€’ Java binary at: /Applications/Android Studio.app/Contents/jre/Contents/Home/bin/java
    β€’ Java version OpenJDK Runtime Environment (build 11.0.12+0-b1504.28-7817840)
    β€’ All Android licenses accepted.

[βœ“] Xcode - develop for iOS and macOS (Xcode 14.1)
    β€’ Xcode at /Applications/Xcode.app/Contents/Developer
    β€’ Build 14B47b
    β€’ CocoaPods version 1.11.3

[βœ“] Chrome - develop for the web
    β€’ Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[βœ“] Android Studio (version 2021.2)
    β€’ Android Studio at /Applications/Android Studio.app/Contents
    β€’ Flutter plugin can be installed from:
      πŸ”¨ https://plugins.jetbrains.com/plugin/9212-flutter
    β€’ Dart plugin can be installed from:
      πŸ”¨ https://plugins.jetbrains.com/plugin/6351-dart
    β€’ Java version OpenJDK Runtime Environment (build 11.0.12+0-b1504.28-7817840)

[βœ“] IntelliJ IDEA Ultimate Edition (version 2022.2.2)
    β€’ IntelliJ at /Applications/IntelliJ IDEA.app
    β€’ Flutter plugin version 70.2.5
    β€’ Dart plugin version 222.4167.21

[βœ“] VS Code (version 1.73.1)
    β€’ VS Code at /Applications/Visual Studio Code.app/Contents
    β€’ Flutter extension can be installed from:
      πŸ”¨ https://marketplace.visualstudio.com/items?itemName=Dart-Code.flutter

[βœ“] Connected device (2 available)
    β€’ macOS (desktop) β€’ macos  β€’ darwin-arm64   β€’ macOS 12.6 21G115 darwin-arm
    β€’ Chrome (web)    β€’ chrome β€’ web-javascript β€’ Google Chrome 107.0.5304.110

[βœ“] HTTP Host Availability
    β€’ All required HTTP hosts are available

β€’ No issues found!

[video_player_web_hls] Unable to play hls vidoes in web

.I'm trying to play hls videos using video_player_web in my flutter web app. But when I try to load the videos it keeps giving "TypeError: Cannot read properties of undefined (reading 'isSupported') at video_player_web_hls.VideoPlayer.new.initialize
(http://localhost:46773/packages/video_player_web_hls/video_player_web

hls.dart.li
b.js:260:37)
at video_player_web_hls.VideoPlayerPluginHls.new.create
(http://localhost:46773/packages/video_player_web_hls/video_player_web_
hls.dart.li
b.js:181:16)
at create.next ()
at runBody (http://localhost:46773/dart_sdk.js:39250:34)
at Object.async [as async]
(http://localhost:46773/dart_sdk.js:39281:7)
at video_player_web_hls.VideoPlayerPluginHls.new.create
(http://localhost:46773/packages/video_player_web_hls/video_player_web

hls.dart.li
b.js:155:20)
at video_player.VideoPlayerController.network.initialize
(http://localhost:46773/packages/video_player/video_player.dart.lib.js:
949:69)
at initialize.next ()
at runBody (http://localhost:46773/dart_sdk.js:39250:34)
at Object._async [as async]
(http://localhost:46773/dart_sdk.js:39281:7)
at video_player.VideoPlayerController.network.initialize
(http://localhost:46773/packages/video_player/video_player.dart.lib.js:
923:20)
at http://localhost:46773/packages/demotest/main.dart.lib.js:287:14
at main._VideoAppState.new.initState
(http://localhost:46773/packages/demotest/main.dart.lib.js:292:11)
at framework.StatefulElement.new.[_firstBuild]
(http://localhost:46773/packages/flutter/src/widgets/widget_span.dart.l
ib.js:53342
:54)
at framework.StatefulElement.new.mount
(http://localhost:46773/packages/flutter/src/widgets/widget_span.dart.l
ib.js:30229
:28)
at RenderObjectToWidgetElement.new.inflateWidget
(http://localhost:46773/packages/flutter/src/widgets/widget_span.dart.l
ib.js:28991
:16)
at RenderObjectToWidgetElement.new.updateChild
(http://localhost:46773/packages/flutter/src/widgets/widget_span.dart.l
ib.js:28845
:25)
at RenderObjectToWidgetElement.new.[_rebuild]
(http://localhost:46773/packages/flutter/src/widgets/widget_span.dart.l
ib.js:55830
:37)
at RenderObjectToWidgetElement.new.mount
(http://localhost:46773/packages/flutter/src/widgets/widget_span.dart.l
ib.js:55809
:29)
at
http://localhost:46773/packages/flutter/src/widgets/widget_span.dart.li
b.js:55742:
37
at framework.BuildOwner.new.buildScope
(http://localhost:46773/packages/flutter/src/widgets/widget_span.dart.l
ib.js:52787
:13)
at RenderObjectToWidgetAdapter.new.attachToRenderTree
(http://localhost:46773/packages/flutter/src/widgets/widget_span.dart.l
ib.js:55741
:17)
at binding$5.WidgetsFlutterBinding.new.attachRootWidget
(http://localhost:46773/packages/flutter/src/widgets/widget_span.dart.l
ib.js:55608
:238)
at
http://localhost:46773/packages/flutter/src/widgets/widget_span.dart.li
b.js:55601:
14
at internalCallback (http://localhost:46773/dart_sdk.js:25311:11)"

Below is the code I'm using

import 'package:video_player/video_player.dart';
import 'package:flutter/material.dart';

void main() {
  runApp(VideoApp());
}

class VideoApp extends StatefulWidget {
  @override
  _VideoAppState createState() => _VideoAppState();
}

class _VideoAppState extends State<VideoApp> {
  VideoPlayerController? _controller;

  @override
  void initState() {
    super.initState();
    try {
      _controller = VideoPlayerController.network(
          'https://bitdash-a.akamaihd.net/content/sintel/hls/playlist.m3u8')
        ..initialize().then((_) {
          // Ensure the first frame is shown after the video is initialized, even before the play button has been pressed.
          setState(() {});
        });
      _controller!.setVolume(0.0);
    } catch (e) {
      print(e);
    }
  }

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Video Demo',
      home: Scaffold(
        body: Center(
          child: _controller!.value.initialized
              ? AspectRatio(
                  aspectRatio: _controller!.value.aspectRatio,
                  child: VideoPlayer(_controller!),
                )
              : Container(),
        ),
        floatingActionButton: FloatingActionButton(
          onPressed: () {
            setState(() {
              _controller!.value.isPlaying
                  ? _controller!.pause()
                  : _controller!.play();
            });
          },
          child: Icon(
            _controller!.value.isPlaying ? Icons.pause : Icons.play_arrow,
          ),
        ),
      ),
    );
  }

  @override
  void dispose() {
    super.dispose();
    _controller!.dispose();
  }
}

Can anyone help me how to solve this issues

Can't play network video from google drive. Flutter web.

I've added video_player and video_player_web_hls as my dependencies. This HLS stream works https://test-streams.mux.dev/x36xhzz/x36xhzz.m3u8. But a video file from google with a link that is constructed like this https://www.googleapis.com/drive/v3/files/$driveFileId?alt=media doesn't work. I'm getting an error MEDIA_ERR_SRC_NOT_SUPPORTED.

some additional context: I've implemented the same video player on mobile and playing video from the same google drive link and it is supported (video plays as expected).

[βœ“] Flutter (Channel stable, 3.7.12, on macOS 14.1.2 23B92 darwin-arm64, locale en-GB)
    β€’ Flutter version 3.7.12 on channel stable at /Users/dbenedictos/fvm/versions/3.7.12
    β€’ Upstream repository https://github.com/flutter/flutter.git
    β€’ Framework revision 4d9e56e694 (9 months ago), 2023-04-17 21:47:46 -0400
    β€’ Engine revision 1a65d409c7
    β€’ Dart version 2.19.6
    β€’ DevTools version 2.20.1

[βœ“] Android toolchain - develop for Android devices (Android SDK version 34.0.0)
    β€’ Android SDK at /Users/dbenedictos/Library/Android/sdk
    β€’ Platform android-33, build-tools 34.0.0
    β€’ Java binary at: /Applications/Android Studio.app/Contents/jbr/Contents/Home/bin/java
    β€’ Java version OpenJDK Runtime Environment (build 11.0.15+0-b2043.56-8887301)
    β€’ All Android licenses accepted.

[βœ“] Xcode - develop for iOS and macOS (Xcode 15.2)
    β€’ Xcode at /Applications/Xcode.app/Contents/Developer
    β€’ Build 15C500b
    β€’ CocoaPods version 1.12.1

[βœ“] Chrome - develop for the web
    β€’ Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[βœ“] Android Studio (version 2022.1)
    β€’ Android Studio at /Applications/Android Studio.app/Contents
    β€’ Flutter plugin can be installed from:
      πŸ”¨ https://plugins.jetbrains.com/plugin/9212-flutter
    β€’ Dart plugin can be installed from:
      πŸ”¨ https://plugins.jetbrains.com/plugin/6351-dart
    β€’ Java version OpenJDK Runtime Environment (build 11.0.15+0-b2043.56-8887301)

[βœ“] IntelliJ IDEA Community Edition (version 2023.1)
    β€’ IntelliJ at /Applications/IntelliJ IDEA CE.app
    β€’ Flutter plugin version 74.0.4
    β€’ Dart plugin version 231.9065

[βœ“] VS Code (version 1.84.2)
    β€’ VS Code at /Applications/Visual Studio Code.app/Contents
    β€’ Flutter extension can be installed from:
      πŸ”¨ https://marketplace.visualstudio.com/items?itemName=Dart-Code.flutter

[βœ“] Connected device (2 available)
    β€’ macOS (desktop) β€’ macos  β€’ darwin-arm64   β€’ macOS 14.1.2 23B92 darwin-arm64
    β€’ Chrome (web)    β€’ chrome β€’ web-javascript β€’ Google Chrome 120.0.6099.234

[βœ“] HTTP Host Availability
    β€’ All required HTTP hosts are available

β€’ No issues found!

[Question] Any recommendations for handling Safari?

Videos do not play on either Safari on Mac, or Safari/Chrome on iOS.

There is some discussion of the issue in the hls.js readme.

Any thoughts on how to work around those issues with this plugin?

version: 0.1.5

initialize() method occasionally throws PlatformException(MEDIA_ERR_NETWORK, networkError, manifestLoadError, null)

VideoPlayerController.network(url)..initialize() method occasionally(not always) throws PlatformException(MEDIA_ERR_NETWORK, networkError, manifestLoadError, null) for a valid m3u8 urls, tested with other players, seems like they load the same urls successfully.

The problem occurs, when trying to re-initialize controller with different url (when re-initializing controller with same url, it seems to load successfully).

TypeError: Cannot read properties of undefined (reading 'isSupported') on Flutter Web

I am trying to initialize the VideoPlayerController in Flutter Web but everytime I load the screen it ends up with this error
TypeError: Cannot read properties of undefined (reading 'isSupported').

Note: I tried different browsers and I got the same error in all of them.

Packages I use in Pubspec.yaml file:
video_player: ^2.7.1
video_player_web_hls: ^1.1.0

Here is how I initialize the controller:

//Code
_VideoPlayerController = VideoPlayerController.networkUrl(Uri.parse(streamUrl))..initialize().
		  then((_) {
            print("initialized");
            // Ensure the first frame is shown after the video is initialized, even before the play button has been pressed.
            
            _controller!.play();
            setState(() {});
          }).onError((error, stackTrace) {
			print("====================================================");
			print(error);
          
            setState(() {});
          });
//End of code

Actual Result:


TypeError: Cannot read properties of undefined (reading 'isSupported')
packages/video_player_web_hls/src/video_player.dart 331:66                        shouldUseHlsLibrary
dart-sdk/lib/_internal/js_dev_runtime/patch/async_patch.dart 84:54                runBody
dart-sdk/lib/_internal/js_dev_runtime/patch/async_patch.dart 123:5                _async
packages/video_player_web_hls/src/video_player.dart 329:35                        shouldUseHlsLibrary
packages/video_player_web_hls/src/video_player.dart 83:15                         initialize
dart-sdk/lib/_internal/js_dev_runtime/patch/async_patch.dart 84:54                runBody
dart-sdk/lib/_internal/js_dev_runtime/patch/async_patch.dart 123:5                _async
packages/video_player_web_hls/src/video_player.dart 72:26                         initialize
packages/video_player_web_hls/video_player_web_hls.dart 97:17                     create
dart-sdk/lib/_internal/js_dev_runtime/patch/async_patch.dart 84:54                runBody
dart-sdk/lib/_internal/js_dev_runtime/patch/async_patch.dart 123:5                _async
packages/video_player_web_hls/video_player_web_hls.dart 50:21                     create
packages/video_player/video_player.dart 426:46                                    initialize
dart-sdk/lib/_internal/js_dev_runtime/patch/async_patch.dart 84:54                runBody
dart-sdk/lib/_internal/js_dev_runtime/patch/async_patch.dart 123:5                _async
packages/video_player/video_player.dart 380:26                                    initialize
packages/.dart 34:65          <fn>
packages/.dart 35:22          initState
packages/flutter/src/widgets/framework.dart 5219:55                               [_firstBuild]
packages/flutter/src/widgets/framework.dart 5062:5                                mount
packages/flutter/src/widgets/framework.dart 3971:15                               inflateWidget
packages/flutter/src/widgets/framework.dart 3708:18                               updateChild
packages/flutter/src/widgets/framework.dart 6435:14                               mount
packages/flutter/src/widgets/framework.dart 3971:15                               inflateWidget
packages/flutter/src/widgets/framework.dart 3708:18                               updateChild
packages/flutter/src/widgets/framework.dart 5111:16                               performRebuild
packages/flutter/src/widgets/framework.dart 4805:7                                rebuild
packages/flutter/src/widgets/framework.dart 5068:5                                [_firstBuild]
packages/flutter/src/widgets/framework.dart 5062:5                                mount
packages/flutter/src/widgets/framework.dart 3971:15                               inflateWidget
packages/flutter/src/widgets/framework.dart 3708:18                               updateChild
packages/flutter/src/widgets/framework.dart 6435:14                               mount
packages/flutter/src/widgets/framework.dart 3971:15                               inflateWidget
packages/flutter/src/widgets/framework.dart 3708:18                               updateChild
packages/flutter/src/widgets/framework.dart 6435:14                               mount
packages/flutter/src/widgets/framework.dart 3971:15                               inflateWidget
packages/flutter/src/widgets/framework.dart 3708:18                               updateChild
packages/flutter/src/widgets/framework.dart 5111:16                               performRebuild
packages/flutter/src/widgets/framework.dart 5251:11                               performRebuild
packages/flutter/src/widgets/framework.dart 4805:7                                rebuild
packages/flutter/src/widgets/framework.dart 5068:5                                [_firstBuild]
packages/flutter/src/widgets/framework.dart 5242:11                               [_firstBuild]
packages/flutter/src/widgets/framework.dart 5062:5                                mount
packages/flutter/src/widgets/framework.dart 3971:15                               inflateWidget
packages/flutter/src/widgets/framework.dart 3708:18                               updateChild
packages/flutter/src/widgets/framework.dart 6435:14                               mount
packages/flutter/src/widgets/framework.dart 3971:15                               inflateWidget
packages/flutter/src/widgets/framework.dart 3708:18                               updateChild
packages/flutter/src/widgets/framework.dart 5111:16                               performRebuild
packages/flutter/src/widgets/framework.dart 5251:11                               performRebuild
packages/flutter/src/widgets/framework.dart 4805:7                                rebuild
packages/flutter/src/widgets/framework.dart 5068:5                                [_firstBuild]
packages/flutter/src/widgets/framework.dart 5242:11                               [_firstBuild]
packages/flutter/src/widgets/framework.dart 5062:5                                mount
packages/flutter/src/widgets/framework.dart 3971:15                               inflateWidget
packages/flutter/src/widgets/framework.dart 3708:18                               updateChild
packages/flutter/src/widgets/framework.dart 6435:14                               mount
packages/flutter/src/widgets/framework.dart 3971:15                               inflateWidget
packages/flutter/src/widgets/framework.dart 3708:18                               updateChild
packages/flutter/src/widgets/framework.dart 5111:16                               performRebuild
packages/flutter/src/widgets/framework.dart 5251:11                               performRebuild
packages/flutter/src/widgets/framework.dart 4805:7                                rebuild
packages/flutter/src/widgets/framework.dart 5068:5                                [_firstBuild]
packages/flutter/src/widgets/framework.dart 5242:11                               [_firstBuild]
packages/flutter/src/widgets/framework.dart 5062:5                                mount
packages/flutter/src/widgets/framework.dart 3971:15                               inflateWidget
packages/flutter/src/widgets/framework.dart 3708:18                               updateChild
packages/flutter/src/widgets/framework.dart 5111:16                               performRebuild
packages/flutter/src/widgets/framework.dart 5251:11                               performRebuild
packages/flutter/src/widgets/framework.dart 4805:7                                rebuild
packages/flutter/src/widgets/framework.dart 5068:5                                [_firstBuild]
packages/flutter/src/widgets/framework.dart 5242:11                               [_firstBuild]
packages/flutter/src/widgets/framework.dart 5062:5                                mount
packages/flutter/src/widgets/framework.dart 3971:15                               inflateWidget
packages/flutter/src/widgets/framework.dart 3708:18                               updateChild
packages/flutter/src/widgets/framework.dart 6435:14                               mount
packages/flutter/src/widgets/framework.dart 3971:15                               inflateWidget
packages/flutter/src/widgets/framework.dart 3708:18                               updateChild
packages/flutter/src/widgets/framework.dart 5111:16                               performRebuild
packages/flutter/src/widgets/framework.dart 5251:11                               performRebuild
packages/flutter/src/widgets/framework.dart 4805:7                                rebuild
packages/flutter/src/widgets/framework.dart 5068:5                                [_firstBuild]
packages/flutter/src/widgets/framework.dart 5242:11                               [_firstBuild]
packages/flutter/src/widgets/framework.dart 5062:5                                mount
packages/flutter/src/widgets/framework.dart 3971:15                               inflateWidget
packages/flutter/src/widgets/framework.dart 3708:18                               updateChild
packages/flutter/src/widgets/framework.dart 6435:14                               mount
packages/flutter/src/widgets/framework.dart 3971:15                               inflateWidget
packages/flutter/src/widgets/framework.dart 3708:18                               updateChild
packages/flutter/src/widgets/framework.dart 5111:16                               performRebuild
packages/flutter/src/widgets/framework.dart 5251:11                               performRebuild
packages/flutter/src/widgets/framework.dart 4805:7                                rebuild
packages/flutter/src/widgets/framework.dart 5068:5                                [_firstBuild]
packages/flutter/src/widgets/framework.dart 5242:11                               [_firstBuild]
packages/flutter/src/widgets/framework.dart 5062:5                                mount
packages/flutter/src/widgets/framework.dart 3971:15                               inflateWidget
packages/flutter/src/widgets/framework.dart 3708:18                               updateChild
packages/flutter/src/widgets/framework.dart 5111:16                               performRebuild
packages/flutter/src/widgets/framework.dart 5251:11                               performRebuild
packages/flutter/src/widgets/framework.dart 4805:7                                rebuild
packages/flutter/src/widgets/framework.dart 5068:5                                [_firstBuild]
packages/flutter/src/widgets/framework.dart 5242:11                               [_firstBuild]
packages/flutter/src/widgets/framework.dart 5062:5                                mount
packages/flutter/src/widgets/framework.dart 3971:15                               inflateWidget
packages/flutter/src/widgets/framework.dart 3708:18                               updateChild
packages/flutter/src/widgets/framework.dart 5111:16                               performRebuild
packages/flutter/src/widgets/framework.dart 4805:7                                rebuild
packages/flutter/src/widgets/framework.dart 5068:5                                [_firstBuild]
packages/flutter/src/widgets/framework.dart 5062:5                                mount
packages/flutter/src/widgets/framework.dart 3971:15                               inflateWidget
packages/flutter/src/widgets/framework.dart 3708:18                               updateChild
packages/flutter/src/widgets/framework.dart 5111:16                               performRebuild
packages/flutter/src/widgets/framework.dart 5251:11                               performRebuild
packages/flutter/src/widgets/framework.dart 4805:7                                rebuild
packages/flutter/src/widgets/framework.dart 5068:5                                [_firstBuild]
packages/flutter/src/widgets/framework.dart 5242:11                               [_firstBuild]
packages/flutter/src/widgets/framework.dart 5062:5                                mount
packages/flutter/src/widgets/framework.dart 3971:15                               inflateWidget
packages/flutter/src/widgets/framework.dart 3708:18                               updateChild
packages/flutter/src/widgets/framework.dart 6435:14                               mount
packages/flutter/src/widgets/framework.dart 3971:15                               inflateWidget
packages/flutter/src/widgets/framework.dart 3708:18                               updateChild
packages/flutter/src/widgets/framework.dart 5111:16                               performRebuild
packages/flutter/src/widgets/framework.dart 4805:7                                rebuild
packages/flutter/src/widgets/framework.dart 5068:5                                [_firstBuild]
packages/flutter/src/widgets/framework.dart 5062:5                                mount
packages/flutter/src/widgets/framework.dart 3971:15                               inflateWidget
packages/flutter/src/widgets/framework.dart 3708:18                               updateChild
packages/flutter/src/widgets/framework.dart 6435:14                               mount
packages/flutter/src/widgets/framework.dart 3971:15                               inflateWidget
packages/flutter/src/widgets/framework.dart 3708:18                               updateChild
packages/flutter/src/widgets/framework.dart 5111:16                               performRebuild
packages/flutter/src/widgets/framework.dart 5251:11                               performRebuild
packages/flutter/src/widgets/framework.dart 4805:7                                rebuild
packages/flutter/src/widgets/framework.dart 5068:5                                [_firstBuild]
packages/flutter/src/widgets/framework.dart 5242:11                               [_firstBuild]
packages/flutter/src/widgets/framework.dart 5062:5                                mount
packages/flutter/src/widgets/framework.dart 3971:15                               inflateWidget
packages/flutter/src/widgets/framework.dart 3708:18                               updateChild
packages/flutter/src/widgets/framework.dart 5111:16                               performRebuild
packages/flutter/src/widgets/framework.dart 4805:7                                rebuild
packages/flutter/src/widgets/framework.dart 5068:5                                [_firstBuild]
packages/flutter/src/widgets/framework.dart 5062:5                                mount
packages/flutter/src/widgets/framework.dart 3971:15                               inflateWidget
packages/flutter/src/widgets/framework.dart 3708:18                               updateChild
packages/flutter/src/widgets/framework.dart 5111:16                               performRebuild
packages/flutter/src/widgets/framework.dart 4805:7                                rebuild
packages/flutter/src/widgets/framework.dart 5068:5                                [_firstBuild]
packages/flutter/src/widgets/framework.dart 5062:5                                mount
packages/flutter/src/widgets/framework.dart 3971:15                               inflateWidget
packages/flutter/src/widgets/framework.dart 3708:18                               updateChild
packages/flutter/src/widgets/framework.dart 5111:16                               performRebuild
packages/flutter/src/widgets/framework.dart 5251:11                               performRebuild
packages/flutter/src/widgets/framework.dart 4805:7                                rebuild
packages/flutter/src/widgets/framework.dart 5068:5                                [_firstBuild]
packages/flutter/src/widgets/framework.dart 5242:11                               [_firstBuild]
packages/flutter/src/widgets/framework.dart 5062:5                                mount
packages/flutter/src/widgets/framework.dart 3971:15                               inflateWidget
packages/flutter/src/widgets/framework.dart 3708:18                               updateChild
packages/flutter/src/widgets/framework.dart 5111:16                               performRebuild
packages/flutter/src/widgets/framework.dart 4805:7                                rebuild
packages/flutter/src/widgets/framework.dart 5068:5                                [_firstBuild]
packages/flutter/src/widgets/framework.dart 5062:5                                mount
packages/flutter/src/widgets/framework.dart 3971:15                               inflateWidget
packages/flutter/src/widgets/framework.dart 3708:18                               updateChild
packages/flutter/src/widgets/framework.dart 5111:16                               performRebuild
packages/flutter/src/widgets/framework.dart 4805:7                                rebuild
packages/flutter/src/widgets/framework.dart 5068:5                                [_firstBuild]
packages/flutter/src/widgets/framework.dart 5062:5                                mount
packages/flutter/src/widgets/framework.dart 3971:15                               inflateWidget
packages/flutter/src/widgets/framework.dart 3708:18                               updateChild
packages/flutter/src/widgets/framework.dart 6435:14                               mount
packages/flutter/src/widgets/framework.dart 3971:15                               inflateWidget
packages/flutter/src/widgets/framework.dart 3708:18                               updateChild
packages/flutter/src/widgets/framework.dart 5111:16                               performRebuild
packages/flutter/src/widgets/framework.dart 4805:7                                rebuild
packages/flutter/src/widgets/framework.dart 5068:5                                [_firstBuild]
packages/flutter/src/widgets/framework.dart 5062:5                                mount
packages/flutter/src/widgets/framework.dart 3971:15                               inflateWidget
packages/flutter/src/widgets/framework.dart 3708:18                               updateChild
packages/flutter/src/widgets/framework.dart 5111:16                               performRebuild
packages/flutter/src/widgets/framework.dart 4805:7                                rebuild
packages/flutter/src/widgets/framework.dart 5068:5                                [_firstBuild]
packages/flutter/src/widgets/framework.dart 5062:5                                mount
packages/flutter/src/widgets/framework.dart 3971:15                               inflateWidget
packages/flutter/src/widgets/framework.dart 3708:18                               updateChild
packages/flutter/src/widgets/framework.dart 5111:16                               performRebuild
packages/flutter/src/widgets/framework.dart 5251:11                               performRebuild
packages/flutter/src/widgets/framework.dart 4805:7                                rebuild
packages/flutter/src/widgets/framework.dart 5068:5                                [_firstBuild]
packages/flutter/src/widgets/framework.dart 5242:11                               [_firstBuild]
packages/flutter/src/widgets/framework.dart 5062:5                                mount
packages/flutter/src/widgets/framework.dart 3971:15                               inflateWidget
packages/flutter/src/widgets/framework.dart 3708:18                               updateChild
packages/flutter/src/widgets/framework.dart 5111:16                               performRebuild
packages/flutter/src/widgets/framework.dart 5251:11                               performRebuild
packages/flutter/src/widgets/framework.dart 4805:7                                rebuild
packages/flutter/src/widgets/framework.dart 5068:5                                [_firstBuild]
packages/flutter/src/widgets/framework.dart 5242:11                               [_firstBuild]
packages/flutter/src/widgets/framework.dart 5062:5                                mount
packages/flutter/src/widgets/framework.dart 3971:15                               inflateWidget
packages/flutter/src/widgets/framework.dart 3708:18                               updateChild
packages/flutter/src/widgets/framework.dart 5111:16                               performRebuild
packages/flutter/src/widgets/framework.dart 5251:11                               performRebuild
packages/flutter/src/widgets/framework.dart 4805:7                                rebuild
packages/flutter/src/widgets/framework.dart 5068:5                                [_firstBuild]
packages/flutter/src/widgets/framework.dart 5242:11                               [_firstBuild]
packages/flutter/src/widgets/framework.dart 5062:5                                mount
packages/flutter/src/widgets/framework.dart 3971:15                               inflateWidget
packages/flutter/src/widgets/framework.dart 3708:18                               updateChild
packages/flutter/src/widgets/framework.dart 6435:14                               mount
packages/flutter/src/widgets/framework.dart 3971:15                               inflateWidget
packages/flutter/src/widgets/framework.dart 3708:18                               updateChild
packages/flutter/src/widgets/framework.dart 5111:16                               performRebuild
packages/flutter/src/widgets/framework.dart 4805:7                                rebuild
packages/flutter/src/widgets/framework.dart 5068:5                                [_firstBuild]
packages/flutter/src/widgets/framework.dart 5062:5                                mount
packages/flutter/src/widgets/framework.dart 3971:15                               inflateWidget
packages/flutter/src/widgets/framework.dart 3708:18                               updateChild
packages/flutter/src/widgets/framework.dart 5111:16                               performRebuild
packages/flutter/src/widgets/framework.dart 4805:7                                rebuild
packages/flutter/src/widgets/framework.dart 5068:5                                [_firstBuild]
packages/flutter/src/widgets/framework.dart 5062:5                                mount
packages/flutter/src/widgets/framework.dart 3971:15                               inflateWidget
packages/flutter/src/widgets/framework.dart 3708:18                               updateChild
packages/flutter/src/widgets/framework.dart 5111:16                               performRebuild
packages/flutter/src/widgets/framework.dart 5251:11                               performRebuild
packages/flutter/src/widgets/framework.dart 4805:7                                rebuild
packages/flutter/src/widgets/framework.dart 5068:5                                [_firstBuild]
packages/flutter/src/widgets/framework.dart 5242:11                               [_firstBuild]
packages/flutter/src/widgets/framework.dart 5062:5                                mount
packages/flutter/src/widgets/framework.dart 3971:15                               inflateWidget
packages/flutter/src/widgets/framework.dart 3708:18                               updateChild
packages/flutter/src/widgets/framework.dart 5111:16                               performRebuild
packages/flutter/src/widgets/framework.dart 5251:11                               performRebuild
packages/flutter/src/widgets/framework.dart 4805:7                                rebuild
packages/flutter/src/widgets/framework.dart 5068:5                                [_firstBuild]
packages/flutter/src/widgets/framework.dart 5242:11                               [_firstBuild]
packages/flutter/src/widgets/framework.dart 5062:5                                mount
packages/flutter/src/widgets/framework.dart 3971:15                               inflateWidget
packages/flutter/src/widgets/framework.dart 6570:36                               inflateWidget
packages/flutter/src/widgets/framework.dart 3708:18                               updateChild
packages/flutter/src/widgets/framework.dart 6153:32                               updateChildren
packages/flutter/src/widgets/framework.dart 6595:17                               update
packages/flutter/src/widgets/framework.dart 3686:14                               updateChild
packages/flutter/src/widgets/framework.dart 5111:16                               performRebuild
packages/flutter/src/widgets/framework.dart 5251:11                               performRebuild
packages/flutter/src/widgets/framework.dart 4805:7                                rebuild
packages/flutter/src/widgets/framework.dart 5274:5                                update
packages/flutter/src/widgets/framework.dart 3686:14                               updateChild
packages/flutter/src/widgets/framework.dart 5111:16                               performRebuild
packages/flutter/src/widgets/framework.dart 4805:7                                rebuild
packages/flutter/src/widgets/framework.dart 5417:5                                update
packages/flutter/src/widgets/framework.dart 3686:14                               updateChild
packages/flutter/src/widgets/framework.dart 5111:16                               performRebuild
packages/flutter/src/widgets/framework.dart 4805:7                                rebuild
packages/flutter/src/widgets/framework.dart 5417:5                                update
packages/flutter/src/widgets/inherited_notifier.dart 107:11                       update
packages/flutter/src/widgets/framework.dart 3686:14                               updateChild
packages/flutter/src/widgets/framework.dart 5111:16                               performRebuild
packages/flutter/src/widgets/framework.dart 5251:11                               performRebuild
packages/flutter/src/widgets/framework.dart 4805:7                                rebuild
packages/flutter/src/widgets/framework.dart 5274:5                                update
packages/flutter/src/widgets/framework.dart 3686:14                               updateChild
packages/flutter/src/widgets/framework.dart 5111:16                               performRebuild
packages/flutter/src/widgets/framework.dart 4805:7                                rebuild
packages/flutter/src/widgets/framework.dart 5417:5                                update
packages/flutter/src/widgets/inherited_notifier.dart 107:11                       update
packages/flutter/src/widgets/framework.dart 3686:14                               updateChild
packages/flutter/src/widgets/framework.dart 5111:16                               performRebuild
packages/flutter/src/widgets/framework.dart 5251:11                               performRebuild
packages/flutter/src/widgets/framework.dart 4805:7                                rebuild
packages/flutter/src/widgets/framework.dart 5274:5                                update
packages/flutter/src/widgets/framework.dart 3686:14                               updateChild
packages/flutter/src/widgets/framework.dart 5111:16                               performRebuild
packages/flutter/src/widgets/framework.dart 5251:11                               performRebuild
packages/flutter/src/widgets/framework.dart 4805:7                                rebuild
packages/flutter/src/widgets/framework.dart 5274:5                                update
packages/flutter/src/widgets/framework.dart 3686:14                               updateChild
packages/flutter/src/widgets/framework.dart 6442:14                               update
packages/flutter/src/widgets/framework.dart 3686:14                               updateChild
packages/flutter/src/widgets/framework.dart 6442:14                               update
packages/flutter/src/widgets/framework.dart 3686:14                               updateChild
packages/flutter/src/widgets/framework.dart 5111:16                               performRebuild
packages/flutter/src/widgets/framework.dart 4805:7                                rebuild
packages/flutter/src/widgets/framework.dart 5417:5                                update
packages/flutter/src/widgets/framework.dart 3686:14                               updateChild
packages/flutter/src/widgets/framework.dart 5111:16                               performRebuild
packages/flutter/src/widgets/framework.dart 5251:11                               performRebuild
packages/flutter/src/widgets/framework.dart 4805:7                                rebuild
packages/flutter/src/widgets/framework.dart 2780:18                               buildScope
packages/flutter/src/widgets/binding.dart 903:9                                   drawFrame
packages/flutter/src/rendering/binding.dart 358:5                                 [_handlePersistentFrameCallback]
packages/flutter/src/scheduler/binding.dart 1284:15                               [_invokeFrameCallback]
packages/flutter/src/scheduler/binding.dart 1214:9                                handleDrawFrame
packages/flutter/src/scheduler/binding.dart 1072:5                                [_handleDrawFrame]
lib/_engine/engine/platform_dispatcher.dart 1236:13                               invoke
lib/_engine/engine/platform_dispatcher.dart 244:5                                 invokeOnDrawFrame
lib/_engine/engine/initialization.dart 190:45                                     <fn>
dart-sdk/lib/_internal/js_dev_runtime/private/ddc_runtime/operations.dart 367:37  _checkAndCall
dart-sdk/lib/_internal/js_dev_runtime/private/ddc_runtime/operations.dart 372:39  dcall
loadeded
====================================================
TypeError: Cannot read properties of undefined (reading 'isSupported')

Flutter Doctor Output:

[βœ“] Flutter (Channel stable, 3.10.6, on Ubuntu 22.04.3 LTS 6.2.0-32-generic, locale en_US.UTF-8)
[βœ“] Android toolchain - develop for Android devices (Android SDK version 32.1.0-rc1)
[βœ“] Chrome - develop for the web
[βœ“] Linux toolchain - develop for Linux desktop
[βœ“] Android Studio (version 2021.2)
[βœ“] VS Code (version 1.82.2)
[βœ“] Connected device (2 available)
[βœ“] Network resources

Upgrade dependency to web 1.0.0

By pinning the web dependency to 0.5.1 it's breaking a lot of other packages. When I override to web ^1.0.0 the following errors are thrown:

video_player.dart:418:54: Error: A value of type 'JSBoolean' can't be assigned to a variable of type 'bool'.
_videoElement.disablePictureInPicture = true.toJS;
^
video_player.dart:428:50: Error: A value of type 'JSBoolean' can't be assigned to a variable of type 'bool'.
_videoElement.disableRemotePlayback = true.toJS;
^

[WEB] HLS with secured http headers

Hey @balvinderz,

video_player allows now to add http headers to request. (flutter/plugins#3671)

Do you plan to implement that feature to allow to access secured .aac files directly from storage?

In my case I store .aac files in secured Amazon S3 Bucket.
I have to be able to calculate separate HTTPS tokens for every .aac file just before I fetch them.

Thanks!

Unable to read m3u8 file from AWS Cloudfront (using AWS Signed URL technology)

I've got several audio and video files in an S3 bucket serviced by Cloudfront. I'm sure that the .m3u8 files are valid, as I can get access to them if I use a signed url. However, I can't seem to get the headers to get passed in the subsequent calls. Here's the code snippet that I'm using (taken string from the initState() method in the sample code):

    String url = "https://cdn.example.com/folder1/folder2/folder3/myMovie.m3u8";
    Map<String, String> httpHeaders = {
      "useCookies": "true",
      "CloudFront-Policy": "${AWSCloudFrontSignedUrl.cloudFrontPolicy}",
      "CloudFront-Signature": "${AWSCloudFrontSignedUrl.cloudFrontSignature}",
      "CloudFront-Key-Pair-Id": "${AWSCloudFrontSignedUrl.cloudFrontKeyPairId}",
    };
    _controller = VideoPlayerController.networkUrl(Uri.parse(url), httpHeaders: httpHeaders)
      ..initialize().then((_) {
        // Ensure the first frame is shown after the video is initialized, even before the play button has been pressed.
        setState(() {});
      });

When the player is trying to intialize, I see that some of the URLs have the correct URL on them, but some do not.
image
This is done in the same network call, but without all of the signature stuff added to it:
image
I'm not sure how to get the player to add the extra parameters to each and every item that is in the playlist. Thanks for your help!

could not read hls.js

Could not read source map for https://cdn.jsdelivr.net/npm/hls.js@latest: Unexpected 404 response from https://cdn.jsdelivr.net/npm/hls.min.js.map: Failed to resolve the requested file.

<title>video_hls_test</title> <script src="https://cdn.jsdelivr.net/npm/hls.js@latest" type="application/javascript"></script> <script src="main.dart.js" type="application/javascript"></script> <script> // The value below is injected by flutter build, do not touch. var serviceWorkerVersion = null; </script> <script src="flutter.js" defer></script> <script> window.addEventListener('load', function(ev) { // Download main.dart.js _flutter.loader.loadEntrypoint({ serviceWorker: { serviceWorkerVersion: serviceWorkerVersion, }, onEntrypointLoaded: function(engineInitializer) { engineInitializer.initializeEngine().then(function(appRunner) { appRunner.runApp(); }); } }); }); </script>

autoplay failed on web

It should throw a error while autoplay blocked by web browser. In the current version, call controller.play() may case controller.value.isInitialized be false, and has no error throwed.

Can't play videos in Android chrome mobile browser

mobile chrome web : error description : PlatformException(MEDIA_ERR_SRC_NOT_SUPPORTED, PIPELINE_ERROR_EXTERNAL_RENDERER_FAILED), The video has been found to be unsuitable (missing or in a format not supported by your browser)., null) ,
video player not intializing it's throwing null how to resolve these issue ?

MEDIA_ERR_SRC_NOT_SUPPORTED

Hello, even with the plugin I keep getting this error what can I do to fix it?

Uncaught (in promise) Error: PlatformException (MEDIA_ERR_SRC_NOT_SUPPORTED, No further diagnostic information can be determined or provided., The video has been found to be unsuitable (missing or in a format not supported by your browser).)

Thank you very much in advance!

Change video quality support

Is it possible to extend VideoPlayerController so I can change the video quality of hls streams. Hls.js supports changing the video quality but I can't figure out how to call the Hls.js api.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.