nova_player 0.1.5 copy "nova_player: ^0.1.5" to clipboard
nova_player: ^0.1.5 copied to clipboard

A Flutter video player package with advanced analytics and interaction tracking capabilities.

Nova Player #

pub package license style: very good analysis

A Flutter video player package with advanced analytics and interaction tracking capabilities.

Features #

  • Advanced video playback controls
  • Comprehensive analytics tracking
  • User interaction monitoring
  • Watchtime tracking
  • Delivery analytics
  • Customizable player UI
  • Support for various video formats
  • Integration with analytics services

Installation #

Add this to your package's pubspec.yaml file:

dependencies:
  nova_player: ^0.1.0

Usage #

Basic Implementation #

import 'package:nova_player/nova_player.dart';

// Initialize the player
final player = NovaPlayer(
  videoUrl: 'https://example.com/video.mp4',
  analyticsService: AnalyticsService(),
);

// Use the player widget
NovaPlayerWidget(
  player: player,
  onInteraction: (interaction) {
    // Handle player interactions
  },
)

Advanced Implementation #

import 'package:nova_player/nova_player.dart';

class VideoPlayerScreen extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    final analyticsService = AnalyticsService();
    
    return Scaffold(
      body: NovaPlayerWidget(
        player: NovaPlayer(
          videoUrl: 'https://example.com/video.mp4',
          analyticsService: analyticsService,
          initialPosition: Duration.zero,
          autoPlay: true,
        ),
        onInteraction: (interaction) {
          // Track user interactions
          analyticsService.trackInteraction(
            videoId: 'video123',
            interaction: interaction,
          );
        },
        onError: (error) {
          // Handle player errors
          print('Player error: $error');
        },
      ),
    );
  }
}

Analytics Integration #

final analyticsService = AnalyticsService();

// Track watchtime
analyticsService.trackWatchtime(
  videoId: 'video123',
  duration: Duration(minutes: 5),
);

// Track delivery analytics
analyticsService.trackDelivery(
  videoId: 'video123',
  deliveryMetrics: DeliveryMetrics(
    bufferTime: Duration(seconds: 2),
    startupTime: Duration(seconds: 1),
  ),
);

// Track user interactions
analyticsService.trackInteraction(
  videoId: 'video123',
  interaction: PlayerInteraction(
    type: InteractionType.play,
    timestamp: DateTime.now(),
    metadata: {
      'position': '00:00:30',
      'volume': '0.8',
    },
  ),
);

API Reference #

NovaPlayer #

The main player class that handles video playback and analytics.

Properties

  • videoUrl: The URL of the video to play
  • analyticsService: The analytics service instance
  • controlsBloc: The player controls bloc for managing player state
  • initialPosition: The initial playback position
  • autoPlay: Whether to start playback automatically

AnalyticsService #

Service for tracking various analytics metrics.

Methods

  • trackWatchtime(): Track video watchtime
  • trackDelivery(): Track delivery metrics
  • trackInteraction(): Track user interactions

PlayerInteraction #

Represents a user interaction with the player.

Properties

  • type: The type of interaction (play, pause, seek, etc.)
  • timestamp: When the interaction occurred
  • metadata: Additional interaction data

Contributing #

Contributions are welcome! Please feel free to submit a Pull Request.

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add some amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

License #

This project is licensed under the MIT License - see the LICENSE file for details.

2
likes
0
points
6
downloads

Publisher

unverified uploader

Weekly Downloads

A Flutter video player package with advanced analytics and interaction tracking capabilities.

Repository (GitHub)
View/report issues

Topics

#video #player #analytics #flutter #media

Documentation

Documentation

License

unknown (license)

Dependencies

defer_pointer, equatable, flutter, flutter_bloc, flutter_hooks, hive, hive_flutter, mayya_core, wakelock_plus, xstream_player

More

Packages that depend on nova_player