Coder Social home page Coder Social logo

landsurveyorsunited / frame-player Goto Github PK

View Code? Open in Web Editor NEW

This project forked from vagnervjs/frame-player

0.0 2.0 0.0 9.3 MB

A video player without video files, just JSON. Based on 'images frames' thought to mobile devices!

Home Page: http://vagnervjs.github.io/frame-player

frame-player's Introduction

#Frame Player

A video player without video files, just JSON. Based on "images frames" thought to mobile devices!

#The Problem The problem of today's HTML5 video is that it can't be played in-line on an HTML page on mobile devices. The way the handheld devices handle it is they open the video in a native player which takes over the page itself, making it impossible to implement any interaction while the video is playing. Also, you can't play two videos at the same time.

#The Solution Create a player instead of playing video files, show a sequence of images at a certain rate.

#Usage

  • Insert this HTML code on any part of your page and set the data-src attribute for your JSON video file
	<div id="my-player" data-vidsrc="videos/video.json"></div>
  • Put the script on your page
	<script src="src/js/frameplayer.js"></script>
  • Set the options
var options = ({
    'rate': 30,
    'controls': false,
    'autoplay': true,
    'width': '640px',
    'height': '390px',
    // 'radius': '50%'
});
  • Init the player
var player = new FramePlayer();
player.load('my-player', options);
player.play();
  • You also can use bower to install frame-player
bower install frame-player

#Generating the JSON Video File

  • Use ffmpeg to generate the frames from a video file:
ffmpeg -i video.mp4 -an -f image2 "%d.jpg"
  • Convert all frames on a single JSON file

    • Option 1: Node.js

       cd converter
       node app.js frameStart frameEnd folder/to/imgs/ json/video.json
    • Option 2: PHP

       php to_data_uri.php frameStart frameEnd folder/to/imgs/ json/video.json

Author

Vagner Santana | --- | --- | --- | --- | --- | --- | --- Vagner Santana
@vagnervjs|

License

frame-player's People

Contributors

vagnervjs avatar

Watchers

Justin Farrow avatar James Cloos 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.