kandi background
Explore Kits

SmarterStreaming | 业内为数不多致力于极致体验的超强全自研跨平台流媒体内核,通过模块化自由组合,支持实时RTMP推流、RTSP推流、RTMP播放器、RTSP播放器、录像、多路流媒体转发、音视频导播、动态视频合成、音频混音、直播互动、内置轻量级RTSP服务等,比快更快,业界真正靠谱的超低延迟直播SDK。 | Media Player library

 by   daniulive Java Version: Current License: No License

 by   daniulive Java Version: Current License: No License

Download this library from

kandi X-RAY | SmarterStreaming Summary

SmarterStreaming is a Java library typically used in Media, Media Player applications. SmarterStreaming has no bugs, it has no vulnerabilities and it has medium support. However SmarterStreaming build file is not available. You can download it from GitHub.
业内为数不多致力于极致体验的超强全自研跨平台(windows/android/iOS)流媒体内核,通过模块化自由组合,支持实时RTMP推流、RTSP推流、RTMP播放器、RTSP播放器、录像、多路流媒体转发、音视频导播、动态视频合成、音频混音、直播互动、内置轻量级RTSP服务等,比快更快,业界真正靠谱的超低延迟直播SDK(1秒内,低延迟模式下200~400ms)。
Support
Support
Quality
Quality
Security
Security
License
License
Reuse
Reuse

kandi-support Support

  • SmarterStreaming has a medium active ecosystem.
  • It has 9647 star(s) with 2561 fork(s). There are 512 watchers for this library.
  • It had no major release in the last 12 months.
  • There are 3 open issues and 112 have been closed. On average issues are closed in 99 days. There are no pull requests.
  • It has a neutral sentiment in the developer community.
  • The latest version of SmarterStreaming is current.
SmarterStreaming Support
Best in #Media Player
Average in #Media Player
SmarterStreaming Support
Best in #Media Player
Average in #Media Player

quality kandi Quality

  • SmarterStreaming has no bugs reported.
SmarterStreaming Quality
Best in #Media Player
Average in #Media Player
SmarterStreaming Quality
Best in #Media Player
Average in #Media Player

securitySecurity

  • SmarterStreaming has no vulnerabilities reported, and its dependent libraries have no vulnerabilities reported.
SmarterStreaming Security
Best in #Media Player
Average in #Media Player
SmarterStreaming Security
Best in #Media Player
Average in #Media Player

license License

  • SmarterStreaming does not have a standard license declared.
  • Check the repository for any license declaration and review the terms closely.
  • Without a license, all rights are reserved, and you cannot use the library in your applications.
SmarterStreaming License
Best in #Media Player
Average in #Media Player
SmarterStreaming License
Best in #Media Player
Average in #Media Player

buildReuse

  • SmarterStreaming releases are not available. You will need to build from source code and install.
  • SmarterStreaming has no build file. You will be need to create the build yourself to build the component from source.
  • Installation instructions are not available. Examples and code snippets are available.
SmarterStreaming Reuse
Best in #Media Player
Average in #Media Player
SmarterStreaming Reuse
Best in #Media Player
Average in #Media Player
Top functions reviewed by kandi - BETA

kandi has reviewed SmarterStreaming and discovered the below as its top functions. This is intended to give you an instant insight into SmarterStreaming implemented functionality, and help decide if they suit your requirements.

  • Inflates the frame layout .
  • Prepare the play frame layout .
  • This is called when a push notification is created .
  • delete all records
  • Initializes camera manager .
  • init and set rpc and config
  • Get the list of files .
  • Calculate max k bit rate .
  • Initializes the camera .
  • Calculate the quality of a video area .

SmarterStreaming Key Features

业内为数不多致力于极致体验的超强全自研跨平台(windows/android/iOS)流媒体内核,通过模块化自由组合,支持实时RTMP推流、RTSP推流、RTMP播放器、RTSP播放器、录像、多路流媒体转发、音视频导播、动态视频合成、音频混音、直播互动、内置轻量级RTSP服务等,比快更快,业界真正靠谱的超低延迟直播SDK(1秒内,低延迟模式下200~400ms)。

编译注意事项

copy iconCopydownload iconDownload
Windows推送端:SmartPublisherDemo	
Windows播放端:SmartPlayer	
Windows转发端:SmartStreamRelayDemo	
Windows合流导播端:SmartMixStreamDemo	
android推送端:SmartPublisherSDKDemo	
android后台Service推送:SmartServicePublisherSDKDemo	
android一对一互动:SmartEchoCancellation	
android播放器:SmartPlayerSDKDemo	
iOS推送端:SmartiOSPublisher	
iOS转发端:SmartiOSRelayDemo	
iOS播放器:SmartiOSPlayer	
iOS一对一互动:SmartiOSEchoCancellation	

Community Discussions

Trending Discussions on Media Player
  • Javafx MediaPlayer runs into error whenever you disconnect bluetooth headphones
  • React Manage Multiple Audios on Same Page and play one at a time using function based components
  • Android Music player in Kotlin
  • Unable to delete .mp3 file due to javaFx MediaPlayer
  • JavaFX MediaPlayer import
  • How do I make a media player control notification in Gtk?
  • Can't play wav or mp3 files with Javafx MediaPlayer. Also can't play wav files with the native java library
  • Is it possible to create a browser based html/javascript audio player, that handles most of the MPRIS commands?
  • How to play audio continuously in xamarin forms
  • Godot: Rename application name used by file explorer in "open with" menu
Trending Discussions on Media Player

QUESTION

Javafx MediaPlayer runs into error whenever you disconnect bluetooth headphones

Asked 2022-Apr-12 at 01:12

I have a highschool capstone where I must create a music player which plays music. However, whenever I connect my bluetooth headphones(airpods or musicozy) and then disconnect them, the MediaPlayer halts and an error is produced. I've searched on the internet for an answer but am unable to find one. If someone could help me that would be great! I'm using Javafx 17.0.2 and JDK 11.

Here's a mini reproducible example below.

JavaFxMediaPlayer

package apprunner;

import java.io.File;
import java.io.IOException;
import java.net.MalformedURLException;
import javafx.application.Application;
import static javafx.application.Application.launch;
import javafx.event.Event;
import javafx.event.EventHandler;
import javafx.scene.Scene;
import javafx.scene.control.Button;
import javafx.scene.media.Media;
import javafx.scene.media.MediaPlayer;
import javafx.stage.Stage;

public class JavaFxMediaPlayer extends Application {

    public static void main(String[] args) throws MalformedURLException, IOException {
        launch(args);

    }

    @Override
    public void start(Stage stage) throws Exception {
        stage.setTitle("My");
        Button button = new Button("Play Song");
        Scene scene = new Scene(button, 200, 100);
        stage.setScene(scene);
        stage.show();
        File file = new File("C:\\Users\\John Doe\\OneDrive\\Desktop\\YourLieInAprilTest\\Mp3Test.mp3");
        String path = file.toURI().toASCIIString();
        Media media = new Media(path);
        MediaPlayer mediaPlayer = new MediaPlayer(media);
        button.setOnAction(new EventHandler() {
            @Override
            public void handle(Event arg0) {
                mediaPlayer.stop();
                mediaPlayer.play();
            }
        });
        Runnable printStackTrace = new Runnable() {
            public void run() {
                mediaPlayer.getError().getMessage();
                mediaPlayer.getError().printStackTrace();
            }
        };
        mediaPlayer.setOnError(printStackTrace);

    }
}

module-info

module MotisHarmony {
    requires javafx.swt;
    requires javafx.base;
    requires javafx.controls;
    requires javafx.fxml;
    requires javafx.graphics;
    requires javafx.media;
    requires javafx.swing;
    requires javafx.web;
    exports mediaplayerjavafx;
    opens mediaplayerjavafx to javafx.graphics;
}

Error Produced

MediaException: PLAYBACK_HALTED : IDirectSoundBuffer_GetStatus The operation completed successfully.
, IDirectSoundBuffer_GetCurrentPosition: The operation completed successfully.
, dwStatus: 0
    at javafx.media/javafx.scene.media.MediaException.haltException(MediaException.java:150)
    at javafx.media/javafx.scene.media.MediaPlayer$_PlayerStateListener.lambda$onHalt$7(MediaPlayer.java:2566)
    at javafx.graphics/com.sun.javafx.application.PlatformImpl.lambda$runLater$10(PlatformImpl.java:457)
    at java.base/java.security.AccessController.doPrivileged(Native Method)
    at javafx.graphics/com.sun.javafx.application.PlatformImpl.lambda$runLater$11(PlatformImpl.java:456)
    at javafx.graphics/com.sun.glass.ui.InvokeLaterDispatcher$Future.run(InvokeLaterDispatcher.java:96)
    at javafx.graphics/com.sun.glass.ui.win.WinApplication._runLoop(Native Method)
    at javafx.graphics/com.sun.glass.ui.win.WinApplication.lambda$runLoop$3(WinApplication.java:184)
    at java.base/java.lang.Thread.run(Thread.java:834)

New JavaFxMediaPlayer Fix Attempt (Seek not working)

package apprunner;

import java.io.File;
import java.io.IOException;
import java.net.MalformedURLException;
import javafx.application.Application;
import static javafx.application.Application.launch;
import javafx.beans.InvalidationListener;
import javafx.beans.Observable;
import javafx.event.Event;
import javafx.event.EventHandler;
import javafx.scene.Scene;
import javafx.scene.control.Button;
import javafx.scene.media.Media;
import javafx.scene.media.MediaPlayer;
import javafx.stage.Stage;
import javafx.util.Duration;

public class AppRunner extends Application {

    public Duration durationBackup = null;

    MediaPlayer mediaPlayer;

    public static void main(String[] args) throws MalformedURLException, IOException {
        launch(args);

    }

    @Override
    public void start(Stage stage) throws Exception {
        stage.setTitle("My");
        Button button = new Button("Play Song");
        Scene scene = new Scene(button, 200, 100);
        stage.setScene(scene);
        stage.show();
        File file = new File("C:\\Users\\John Doe\\OneDrive\\Desktop\\YourLieInAprilTest\\Mp3Test.mp3");
        String path = file.toURI().toASCIIString();
        Media media = new Media(path);
        mediaPlayer = new MediaPlayer(media);
        button.setOnAction(new EventHandler() {
            @Override
            public void handle(Event arg0) {
                mediaPlayer.stop();
                mediaPlayer.play();
            }
        });
        mediaPlayer.currentTimeProperty().addListener(new InvalidationListener() {
            public void invalidated(Observable ov) {
                //Here we keep a backup of the current duration of the song just incase the mediaPlayer crashes, which it does everytime you disconnect a bluetooth headset for some reason
                durationBackup = mediaPlayer.getCurrentTime();
            }
        });
        //Here I try to create a new MediaPlayer and go to the last position we were at before the mediaPlayer halted
        Runnable attemptToResetMediaPlayer = new Runnable() {
            public void run() {
                mediaPlayer = new MediaPlayer(media);
                mediaPlayer.play();
                System.out.println(durationBackup.toMillis());
                mediaPlayer.seek(durationBackup);
            }
        };
        mediaPlayer.setOnError(attemptToResetMediaPlayer);
    }
}

How to recreate bug

  • First you must connect your bluetooth headphones to your laptop/computer
  • Then you must run the mini reproducible example above
  • Then you must click on the "Play Song" button which appears
  • Then when the song is playing, disconnect your bluetooth headphones
  • The mediaPlayer will halt and the error message and its stack trace will be printed

Extra Information

Link to the Mp3 file I used to test. https://drive.google.com/file/d/1CvAafbMviQ7nvKyojnem9GK73LJsD6MJ/view?usp=sharing

I am using JDK 11 and Javafx 17.0.2

System Type: 64-bit operating system, x64-based processor

Processor: Intel(R) Core(TM) i7-7700HQ CPU @ 2.80GHz 2.81 GHz

Windows Edition: Windows 10 Home

ANSWER

Answered 2022-Apr-12 at 01:12

The problem with your recovery is that you are seeking too soon. The docs for seek state that it does nothing while the media player is stopped, but you aren't waiting for the state to change after calling play().

Try this:

    mediaPlayer.setOnError( () -> {
            mediaPlayer = new MediaPlayer(media);
            System.out.println(durationBackup.toMillis());
            mediaPlayer.setOnPlaying(() ->{
                mediaPlayer.seek(durationBackup);
                mediaPlayer.setOnPlaying(null);
            });
            mediaPlayer.play();
    });

Source https://stackoverflow.com/questions/71820204

Community Discussions, Code Snippets contain sources that include Stack Exchange Network

Vulnerabilities

No vulnerabilities reported

Install SmarterStreaming

You can download it from GitHub.
You can use SmarterStreaming like any standard Java library. Please include the the jar files in your classpath. You can also use any IDE and you can run and debug the SmarterStreaming component as you would do with any other Java program. Best practice is to use a build tool that supports dependency management such as Maven or Gradle. For Maven installation, please refer maven.apache.org. For Gradle installation, please refer gradle.org .

Support

For any new features, suggestions and bugs create an issue on GitHub. If you have any questions check and ask questions on community page Stack Overflow .

DOWNLOAD this Library from

Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from
over 430 million Knowledge Items
Find more libraries
Reuse Solution Kits and Libraries Curated by Popular Use Cases

Save this library and start creating your kit

Explore Related Topics

Share this Page

share link
Consider Popular Media Player Libraries
Compare Media Player Libraries with Highest Support
Compare Media Player Libraries with Highest Security
Compare Media Player Libraries with Permissive License
Compare Media Player Libraries with Highest Reuse
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from
over 430 million Knowledge Items
Find more libraries
Reuse Solution Kits and Libraries Curated by Popular Use Cases

Save this library and start creating your kit

  • © 2022 Open Weaver Inc.