Coder Social home page Coder Social logo

danmuplayer's Introduction

A ffmpeg based player for tvOS TVML support DanMu

A front-end HUD similiar to built-in Player.

Javascript API Similar to TVML built-in Player.

Back-end based on a modified for tvOS ijkplayer

My project LazyCat use DanMuPlayer to play bili and panda video and live stream with dynamic subtitles (danmu弹幕).

JavaScript API Sample:

let video = new DMMediaItem('video', video_url);
video.url = video_url;
video.artworkImageURL = data.img;
video.title = data.MovieName;
video.description = data.description;
let videoList = new DMPlaylist();
videoList.push(video);
let myPlayer = new DMPlayer();
myPlayer.playlist = videoList;
myPlayer.addEventListener('timeBoundaryDidCross', (listener, extraInfo) => {
    console.log("bound: " + listener.boundary);
}, time_array);
myPlayer.addEventListener('timeDidChange', function(listener,extraInfo) {
    console.log("time: " + listener.time);
},{interval: 1});
myPlayer.addEventListener('stateDidChange', function(listener, extraInfo) {
    console.log("state: " + listener.state);
},{});
myPlayer.addDanMu(msg="This is a test", color=0xFF0000, fontSize=25, style=0);
//style 0:normal 1:top 2:bottom
myPlayer.play()

New feature and bug fix still ongoing...

Integreting and Build Step:

1. git submodule add https://github.com/qiudaomao/DanMuPlayer.git DanMuPlayer

2. cd DanMuPlayer && git submodule update --init --recursive

3. cd ijplayer ./ios-init.sh, cd ./ios, ./build-openssl.sh && ./build-ffmpeg.sh

4. drag DanMuPlayer.xcodeproject and IJKMediaFramework.xcodeproj to your project

5. Add below line to tvos swift project to finish basic setup

#import <DanMuPlayer.h>//add this line to objc-swift bridge file YourProjectName-Bridging-Header.h

func appController(_ appController: TVApplicationController, evaluateAppJavaScriptIn jsContext: JSContext) {
    *DMPlayer.setup(jsContext, controller: appController.navigationController)*
}

#finally call the player from javascript

Demo from LazyCat:

a.jpg

b.jpg

danmuplayer's People

Contributors

qiudaomao avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

danmuplayer's Issues

I can't build ijkplayer for this project

The one linked from this project returns a openssl error when building. I also found a tvos port but that does not build either
https://github.com/qiudaomao/ijkplayer/tree/tvos

Even if this is a few months old, it seems it uses a different ijkplayer. There are no ios-init.sh and build-openssl.sh in neither branches of ijkplayer that I found.

Could you point me to the right ijkplayer branch? Thank you

缺少 <mpv/client.h>和dependency/mpv的文件

编译的时候提示缺少 <mpv/client.h>和dependency/mpv的文件,请问哪里能下到吗?
谢谢!

clang: error: no such file or directory: 'DanMuPlayer/dependency/mpv/lib/archive.a'
clang: error: no such file or directory: 'DanMuPlayer/dependency/mpv/lib/expat.a'
clang: error: no such file or directory: 'DanMuPlayer/dependency/mpv/lib/bluray.a'
clang: error: no such file or directory: 'DanMuPlayer/dependency/mpv/lib/harfbuzz-subset.a'
clang: error: no such file or directory: 'DanMuPlayer/dependency/mpv/lib/harfbuzz.a'
clang: error: no such file or directory: 'DanMuPlayer/dependency/mpv/lib/fribidi.a'
clang: error: no such file or directory: 'DanMuPlayer/dependency/mpv/lib/uchardet.a'
clang: error: no such file or directory: 'DanMuPlayer/dependency/mpv/lib/uuid.a'
clang: error: no such file or directory: 'DanMuPlayer/dependency/mpv/lib/fontconfig.a'
clang: error: no such file or directory: 'DanMuPlayer/dependency/mpv/lib/png.a'
clang: error: no such file or directory: 'DanMuPlayer/dependency/mpv/lib/png16.a'
clang: error: no such file or directory: 'DanMuPlayer/dependency/mpv/lib/freetype.a'
clang: error: no such file or directory: 'DanMuPlayer/dependency/mpv/lib/ass.a'

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.