Coder Social home page Coder Social logo

bitmovin / bitmovin-javascript Goto Github PK

View Code? Open in Web Editor NEW
67.0 25.0 23.0 2.2 MB

DEPRECATED: JavaScript client for the Bitmovin API, see https://github.com/bitmovin/bitmovin-api-sdk-javascript

License: MIT License

JavaScript 0.37% TypeScript 99.63%
javascript bitmovin api-client nodejs video-encoding analytics html5-player bitmovin-api

bitmovin-javascript's Introduction

bitmovin

New API Client (Recommended)

bitmovin-javascript is the legacy Bitmovin API client for JavaScript.

We recommend using the new client, which you can find at bitmovin-api-sdk-javascript. Using the new client guarantees 100% specification conformity at any given time and access to all features of the API as soon as they are released.


Bitmovin Javascript API Client

bitmovin codecov npm version Build Status

Javascript-API-Client which enables you to seamlessly integrate the Bitmovin API into your projects. Using this API client requires an active account.

Sign up for a Bitmovin Account!

The full API reference can be found here.

Installation

npm install bitmovin-javascript

or with yarnpkg

yarn add bitmovin-javascript

Initialization

Node

Using ES6 import

import Bitmovin from 'bitmovin-javascript';
const bitmovin = Bitmovin({'apiKey': '<YOUR_API_KEY>'});

With require

const Bitmovin = require('bitmovin-javascript').default;
const bitmovin = Bitmovin({'apiKey': '<YOUR_API_KEY>'});

Browser

Use bitmovin-javascript/dist/bitmovin.browser.js or bitmovin.browser.min.js for the minified version.

ES5 with Modules (CommonJS)

Import bitmovin-javascript/dist/index.js.

Types

  • Typescript (bitmovin-javascript/dist/index.d.ts)

Usage

The Bitmovin-Javascript API Client is closely modeled after our Bitmovin API Reference Bitmovin API. Each resource in the API Reference has a 1:1 mapping in our API Client.

All methods return a Promise Object that will return the fetched result values from the API.

So for example the list all inputs call is defined as GET v1/encoding/inputs in our API-Reference and simply corresponds to:

const limit = 100;
const offset = 0;
bitmovin.encoding.inputs.list(limit, offset).then(result => {
  const {items} = result;
  items.forEach(input => {
    console.log(input.name);
  });
});

Examples

An sample DASH & HLS encoding sample can be found in examples/encoding/01_simple_encoding_dash_manifest.js

For more examples visit our example page.

Contributing

If you want to contribute feel free to send pull requests. Code quality is ensured through lint-staged, please make sure all tests are passing with yarn test.

Upgrade from v1

Version 2 of the Bitmovin JavaScript client still has the same 1:1 mapping as v1. With v2 we improved the bundling and changed the default export to not require a new to create a Bitmovin "object". Internally the client changed quite a lot as you can see in this pull request.

License

MIT

bitmovin-javascript's People

Contributors

clemenshelm avatar dominic-miglar avatar domysee avatar fabiandev avatar flofischer avatar jonathanhperry avatar jschausberger avatar koraygulcu avatar kulenovicines avatar ludomichaud avatar lukaskroepfl avatar matt-lee-bitmovin avatar moser4035 avatar peterpf avatar rfliam avatar rolandgriesser avatar sabe25 avatar since avatar svarozic avatar theelk205 avatar tigraine avatar vzablock avatar yrwein 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  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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

bitmovin-javascript's Issues

Unclear Trickplay documentation for iFramePlaylist - Help wanted.

I'm struggling to create an iframe manifest. I've read all the documentation and articles that I can find, but everything is fragmented.
https://bitmovin.com/docs/player/articles/player-thumbnail-preview-support
https://bitmovin.com/docs/encoding/api-reference/sections/manifests#/Encoding/PostEncodingManifestsHlsStreamsIframeByManifestIdAndStreamId

  1. The process is unclear. Am I supposed to generate the thumbnails, then create a manifest with those thumbnails and attach it to the main manifest? Or does https://bitmovin.com/docs/encoding/api-reference/sections/manifests#/Encoding/PostEncodingManifestsHlsStreamsIframeByManifestIdAndStreamId do something completely different?

I would love some help or direction on this.

403 forbidden error

I'm trying to run the Dash on demand example with my api key and new inputs and outputs, but all I get is this:

Unhandled rejection Error: HTTP Request was unsuccessful: HTTP Response Code was 403 Forbidden
at new BitmovinError (/home/ubuntu/ibm/node_modules/bitmovin-javascript/dist/utils/BitmovinError.js:16:28)
at /home/ubuntu/ibm/node_modules/bitmovin-javascript/dist/utils/http.js:42:23
at process._tickCallback (internal/process/next_tick.js:103:7)

Any idea what could be causing it?

ionic3 about problem

java 后台传送一个byte数组的字节 比如byte [] b={5,9,5}.
ionic3, 用response.arrayBuffer接收的传过来的字节,ionic3 显示的是b=5,0,9,0,5 。为什么每一个字节后面会多出一个0?

npm install fails

When attempting to install the client for modification to add missing endpoints after cloning from github. Note that simply installing the client direct from npm does work.

Occurs on both Windows and Ubuntu during npm install.

$ cross-env NODE_ENV=development webpack --config=./webpack4.config.js
C:\work\bitmovin-javascript\node_modules\webpack-cli\bin\config-yargs.js:89
                                describe: optionsSchema.definitions.output.properties.path.description,
                                                                           ^

TypeError: Cannot read property 'properties' of undefined
    at module.exports (C:\work\bitmovin-javascript\node_modules\webpack-cli\bin\config-yargs.js:89:48)
    at C:\work\bitmovin-javascript\node_modules\webpack-cli\bin\webpack.js:60:27
    at Object.<anonymous> (C:\work\bitmovin-javascript\node_modules\webpack-cli\bin\webpack.js:515:3)
    at Module._compile (module.js:652:30)
    at Object.Module._extensions..js (module.js:663:10)
    at Module.load (module.js:565:32)
    at tryModuleLoad (module.js:505:12)
    at Function.Module._load (module.js:497:3)
    at Module.require (module.js:596:17)
    at require (internal/module.js:11:18)
error Command failed with exit code 1.

Use progressive as fallback URL

I need to have an mp4 fallback URL for when my HLS / Dash players don't work for the following errors:

  • SOURCE_COULD_NOT_LOAD_MANIFEST (if I put a link with a typo)
  • SOURCE_NO_SUPPORTED_TECHNOLOGY (if I don't even put an HLS / Dash link)

We could use the progressive as that fallback, but instead we get an error message.

This is a related issue

Api slow

Setting up my encoding takes about 85 seconds.
That seems to be quite a lot for an api, that more or less sets up some objects.

While this pr helps a bit (down to 50 seconds)
#55
i wonder, if there is other things i can do to speed up the encoding configuration?

Is it good practice to recreate everything everytime when i want to encode something?
Or is there a way to set things up once and only change the input and output configuration?

After running the node file to run encoding on bitmovin cloud I get error 404?

So I am using the client node js to run the encoding of the test mp4 provided by bitmovin, I followed the demo that is presented by bitmovin. But after running the node js file I get an error 404 http. The error starts after I set the input path and at the part where I start adding the streams.

Now I have this issue can someone please help?

I have other questions as I don't know where to ask the bitmovin team:

  1. Why I cant just encode a mp4 file without implementing a client code?

  2. after I encoded test file using the UI provided by bitmovin to test encoding, I cant find anything in output tab.....it seems broken (has a 404 error)?

Thanks for your help.

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.