Git Product home page Git Product logo

vr-player's Introduction

VrPlayer

VR Player Plugin for Flutter

Getting Started

Based on Kaltura Playkit SDK.

The VrPlayer plugin lets you play 360° and VR videos smoothly on Android and iOS platforms, delivering an immersive viewing experience with touch and device motion controls. These types of videos, commonly referred to as immersive, 360, or spherical videos, are captured by utilizing an omnidirectional camera or multiple cameras to record the entire panoramic view simultaneously.

Usage

VrPlayer(
  x: 0,
  y: 0,
  onCreated: onViewPlayerCreated,
  width: playerWidth,
  height: playerHeight,
),

You must implement onViewPlayerCreated to receive player events.

void onViewPlayerCreated(
  VrPlayerController controller
  VrPlayerObserver observer
) {
  this.viewPlayerController = controller;
  /// Receive player state [loading, ready, buffering]
  observer.handleStateChange(this.onReceiveState);
  /// Receive duration in millis
  observer.handleDurationChange(this.onReceiveDuration);
  /// Receive current position in millis
  observer.handlePositionChange(this.onReceivePosition);
  /// Receive when video is finished
  observer.handleFinishedChange(this.onReceiveFinished);
  this.viewPlayerController.loadVideo(
    videoUrl: "https://cdn.bitmovin.com/content/assets/playhouse-vr/m3u8s/105560.m3u8"
  );
}

VrPlayerController

The VrPlayerController can be used to change the state of a VrPlayer Note that the methods can only be used after the VrPlayer has been created.

Method Description
loadVideo({String? videoUrl, String? videoPath}) Initializes video based on configuration. Invoke actions which need to be run on player start. Pass videoPath to load local files, or videoUrl to play files from network. Local files supports only Android.
isPlaying() Check current player state.
play() Play video.
pause() Pause video.
seekTo() Seek to position.
setVolume() Set video volume level from 0 (no sound) to 1 (max).
fullScreen() (Android only) Enable/disable fullscreen mode. On IOS you need to pass new width and height to VrPlayer widget
toggleVRMode() Switch between 360° mode and VR mode.
onSizeChanged() (Android only) Reload player when you need to change size of nativeView.
onPause() (Android only) Dispose player on pause.
onResume() (Android only) Reload player.
onOrientationChanged() (Android only) Notily player when orientation changed.

License Information

All code in this project is released under the AGPLv3 license unless a different license for a particular library is specified in the applicable library path.

Contribution

This repository welcomes contributions from the community! Whether you're looking to fix bugs, improve existing features, or add new ones, we would be happy to review and merge your contributions.

vr-player's People

Contributors

temaand1 avatar kirillsergeevich avatar

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.