Elemental2 Media

Thin Java abstractions for the native media APIs provided by the browser.

License

License

GroupId

GroupId

org.realityforge.com.google.elemental2
ArtifactId

ArtifactId

elemental2-media
Last Version

Last Version

2.27
Release Date

Release Date

Type

Type

jar
Description

Description

Elemental2 Media
Thin Java abstractions for the native media APIs provided by the browser.
Source Code Management

Source Code Management

https://github.com/google/elemental2

Download elemental2-media

How to add to project

<!-- https://jarcasting.com/artifacts/org.realityforge.com.google.elemental2/elemental2-media/ -->
<dependency>
    <groupId>org.realityforge.com.google.elemental2</groupId>
    <artifactId>elemental2-media</artifactId>
    <version>2.27</version>
</dependency>
// https://jarcasting.com/artifacts/org.realityforge.com.google.elemental2/elemental2-media/
implementation 'org.realityforge.com.google.elemental2:elemental2-media:2.27'
// https://jarcasting.com/artifacts/org.realityforge.com.google.elemental2/elemental2-media/
implementation ("org.realityforge.com.google.elemental2:elemental2-media:2.27")
'org.realityforge.com.google.elemental2:elemental2-media:jar:2.27'
<dependency org="org.realityforge.com.google.elemental2" name="elemental2-media" rev="2.27">
  <artifact name="elemental2-media" type="jar" />
</dependency>
@Grapes(
@Grab(group='org.realityforge.com.google.elemental2', module='elemental2-media', version='2.27')
)
libraryDependencies += "org.realityforge.com.google.elemental2" % "elemental2-media" % "2.27"
[org.realityforge.com.google.elemental2/elemental2-media "2.27"]

Dependencies

compile (5)

Group / Artifact Type Version
com.google.jsinterop : jsinterop-annotations jar 1.0.2
com.google.jsinterop : base jar 1.0.0
org.realityforge.com.google.elemental2 : elemental2-core jar 2.27
org.realityforge.com.google.elemental2 : elemental2-dom jar 2.27
org.realityforge.com.google.elemental2 : elemental2-promise jar 2.27

Project Modules

There are no modules declared in this project.

Elemental2 · Build Status

Elemental2 provides type checked access to all browser APIs for Java code. This is done by using closure extern files and generating JsTypes, which are part of the new JsInterop specification that is both implemented in GWT and J2CL.

Bazel dependencies

If your project uses Bazel, add this repository as an external dependency in your WORKSPACE file:

load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")

http_archive(
    name = "com_google_elemental2",
    strip_prefix = "elemental2-1.1.0",
    url = "https://github.com/google/elemental2/archive/1.1.0.zip",
)

load("@com_google_elemental2//build_defs:repository.bzl", "load_elemental2_repo_deps")
load_elemental2_repo_deps()

load("@com_google_elemental2//build_defs:workspace.bzl", "setup_elemental2_workspace")
setup_elemental2_workspace()

Now from you can add elemental2 targets as needed to your j2cl_library deps.

Following are the different elemental2 modules and their target names:

module Bazel targets for J2CL
core @com_google_elemental2//:elemental2-core-j2cl
dom @com_google_elemental2//:elemental2-dom-j2cl
promise @com_google_elemental2//:elemental2-promise-j2cl
indexeddb @com_google_elemental2//:elemental2-indexeddb-j2cl
svg @com_google_elemental2//:elemental2-svg-j2cl
webgl @com_google_elemental2//:elemental2-webgl-j2cl
media @com_google_elemental2//:elemental2-media-j2cl
webstorage @com_google_elemental2//:elemental2-webstorage-j2cl

Maven dependencies

If your project uses Maven, add the following maven dependencies in your pom.xml:

<dependency>
  <groupId>com.google.elemental2</groupId>
  <artifactId>${artifact-id}</artifactId>
  <version>1.1.0</version>
</dependency>
module artifact-id
core elemental2-core
dom elemental2-dom
promise elemental2-promise
indexeddb elemental2-indexeddb
svg elemental2-svg
webgl elemental2-webgl
media elemental2-media
webstorage elemental2-webstorage

Download the jar files

You can also download manually the jars files.

module jar file
core elemental2-core.jar
dom elemental2-dom.jar
promise elemental2-promise.jar
indexeddb elemental2-indexeddb.jar
svg elemental2-svg.jar
webgl elemental2-webgl.jar
media elemental2-media.jar
webstorage elemental2-webstorage.jar

GWT

Elemental2 v1.0.0+ requires GWT 2.9 or above.

If you use Elemental2 with GWT, you need to inherit the right gwt module in your gwt.xml file:

module GWT module name
core elemental2.core.Core
dom elemental2.dom.Dom
promise elemental2.promise.Promise
indexeddb elemental2.indexeddb.IndexedDb
svg elemental2.svg.Svg
webgl elemental2.webgl.WebGl
media elemental2.media.Media
webstorage elemental2.webstorage.WebStorage

Build GWT compatible maven jar files

If you want to modify and/or build the last version on your own, follow the instructions below:

    $ npm install -g @bazel/bazelisk
    $ alias bazel=bazelisk
  • Clone this git repository:
    $ git clone https://github.com/google/elemental2.git
  • Run the release script:
        $ cd elemental2
        $ ./maven/release_elemental.sh --version local --no-deploy

The script will output the directory containing the generated jar files that can be used with maven.

Contributing

Please refer to the contributing document.

Licensing

Please refer to the license file.

Disclaimer

This is not an official Google product.

org.realityforge.com.google.elemental2

Google

Google ❤️ Open Source

Versions

Version
2.27
2.26
2.25
2.24
2.23
2.22
1.0.0-rf-p14-2f97dbe
1.0.0-rf-p13-095e529
1.0.0-b21-6a027d2
1.0.0-b20-bfe6e22
1.0.0-b19-fb227e3
1.0.0-b18-f3472e7
1.0.0-b17-6897368
1.0.0-b16-6897368
1.0.0-b15-7a28038
1.0.0-b14-2f97dbe