This Flutter project demonstrates a video player functionality using the chewie
package and BLoC architecture.
- Play and loop different videos.
- Show options widget to select the video type.
- Display video player controls.
- Flutter SDK installed on your machine.
-
Clone the repository:
-
Navigate to the project directory:
-
Install the dependencies:
-
Run the app:
This file contains the VideoPlayerBloc
class, which extends the Bloc
class from the bloc
package. It manages the state and business logic for the video player feature. It handles events and emits corresponding states.
This file defines the events that can be dispatched to the VideoPlayerBloc
. It includes events such as VideoPlayerInitialEvent
and VideoPlayerChangeFutureVideoEvent
for initializing and changing the future video respectively.
This file defines the states that the VideoPlayerBloc
can emit. It includes states such as VideoPlayerInitialState
and VideoPlayerSuccessVideoState
to represent the initial and successful video states respectively.
This file contains the VideoPlayerPage
class, which is a StatefulWidget
representing the main page of the video player feature. It initializes the VideoPlayerBloc
and handles user interactions with the video player widget.
This file contains the VideoPlayerWidget
class, which is a StatefulWidget
representing the video player widget. It receives the VideoPlayerBloc
and a UiObjectModelClickListener
as parameters. It displays the video player using the chewie
package and handles user interactions.
This file contains the VideoPlayerOptionsWidget
class, which is a StatelessWidget
representing the options widget for selecting the video type. It receives the VideoPlayerBloc
, UiObjectModelClickListener
, and a VideoPlayerOptionsWidgetUiModel
as parameters. It displays the options widget and handles user interactions to change the video type.
This file contains the UiObjectModel
interface, which is implemented by different UI models used in the app. It provides a common interface for interacting with UI models.
- chewie package for the video player functionality.