Code Monkey home page Code Monkey logo

broadway's Introduction

A way to autoplay inline video animation on mobile devices

This is a fork of the Broadway H.264 decoder. The focus here is on using that amazing decoder to play back H.264 encoded mp4 files as a gif replacment, where the HTML5 video tag is not suitable (Like on iOS and Android, which both can't autoplay html5 video).

This solution is ready to be used on a website. Check out the demo.html in the Player folder.

Limitations

The entire video file has to be downloaded first by the client before it can be played back. If this is an issue for you, this fork isn't for you. You could build your own player with WebSockets based on BroadwayStream.

Only h.264 encoded mp4 files are supported. There are certain limitations on the encoding profile, weighted prediction for P-frames as well as CABAC entropy encoding are not supported by the Broadway decoder.

If you encode your videos with ffmpeg, here is an example:

ffmpeg -y -i input.mp4 -vcodec libx264 -pass 1 -coder 0 -bf 0 -wpredp 0 -an -x264opts no-cabac:no-weightb -pix_fmt yuv420p -vf scale=568:320 output.mp4

Usage

Load the broadwayPlayer-min.js file from the Player folder and add the following markup:

<div class="broadway" src="video.mp4" loop="true" webgl="auto" workers="false" />

Once the video is loaded, a canvas element is added to the div and the video frames are rendered to that canvas. Make sure your video is encoded regarding the above mentioned limitations.

broadway's People

Contributors

bkw avatar emersion avatar fresswolf avatar hikari-no-yume avatar hotsphink avatar kripken avatar mbebenita avatar p01 avatar samsamm777 avatar saste avatar soliton4 avatar

Watchers

 avatar  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.