Giter Club home page Giter Club logo

mobile-inline-player's Introduction

Mobile Inline Player

http://aita.github.io/mobile-inline-player/

Mobile Inline Player is a MPEG1 player for mobile browsers. It supports pseudo video-streaming with multiple MPEG1 files and auto inline-playing on iPhone and Android.

Usage

<div data-src="video.json" data-mp4="fullscreen.mp4" data-endcard="endcard.jpg"></div>
<script src="mobile-inline-player.js"></script>

Options

Key Description
data-src a playlist URL
data-mp4 a mp4 video URL for full screen
data-endcard an endcard image URL
data-width video width
data-height video height
data-preload-timeout a time limit for preloading (in micro seconds)

File format

JSON

{
  "url": [
    "aaa.mpg",
    "bbb.mpg"
  ]
}

License Issue

Although Mobile Inline Player is under MIT license, jsmpeg is largely based on "Java MPEG-1 Video Decoder and Player" which is under GPL. I'm not sure jsmpeg and this library are devrived works of "Java MPEG-1 Video Decoder and Player" or not. But you should be careful when you use this library on commercial sites.

Limitations

  • MPEG files with B-Frames look weird - frames are not reordered. This should be relatively easy to fix, but most encoders seem to not use B-Frames at all by default.
  • The width of the MPEG video has to be a multiple of 2.
  • Only raw MPEG video streams are supported. The decoder hates Stream Packet Headers in between macroblocks.

You can use FFmpeg to encode videos in a suited format. This will crop the size to a multiple of 2, omit B-Frames and force a raw video stream:

ffmpeg -i in.mp4 -f mpeg1video -vf "crop=iw-mod(iw\,2):ih-mod(ih\,2)" -bf 0 out.mpg

mobile-inline-player's People

Contributors

aita avatar james-tr avatar maikmerten avatar phoboslab avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

mobile-inline-player's Issues

リファクタリング

元の実装が扱いづらいので、全体的にコードベースのリファクタリングを進める

  • ファイルの分割
  • PlayerとDecoderの実装の分離
  • videoデータの入ったArrayBufferを直接渡せるようにする
    • Ajaxリクエストとバッファの読込を分離する
  • 擬似ストリーミング対応
    • ダウンローダーを別オブジェクトとして実装する
  • コールバックをEventベースにする
    • 擬似ストリーミング対応の実装の簡易にするのため
  • WebSocket Streamingの排除
    • 一旦邪魔なのでまるごと消す
  • Canvasのサイズを勝手に変えないようにする

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.