Rename project to just_audio
This commit is contained in:
parent
0574c041c5
commit
108821871d
|
@ -2,9 +2,9 @@
|
|||
<project version="4">
|
||||
<component name="ProjectModuleManager">
|
||||
<modules>
|
||||
<module fileurl="file://$PROJECT_DIR$/audio_player.iml" filepath="$PROJECT_DIR$/audio_player.iml" />
|
||||
<module fileurl="file://$PROJECT_DIR$/android/audio_player_android.iml" filepath="$PROJECT_DIR$/android/audio_player_android.iml" />
|
||||
<module fileurl="file://$PROJECT_DIR$/example/android/audio_player_example_android.iml" filepath="$PROJECT_DIR$/example/android/audio_player_example_android.iml" />
|
||||
<module fileurl="file://$PROJECT_DIR$/just_audio.iml" filepath="$PROJECT_DIR$/just_audio.iml" />
|
||||
<module fileurl="file://$PROJECT_DIR$/android/just_audio_android.iml" filepath="$PROJECT_DIR$/android/just_audio_android.iml" />
|
||||
<module fileurl="file://$PROJECT_DIR$/example/android/just_audio_example_android.iml" filepath="$PROJECT_DIR$/example/android/just_audio_example_android.iml" />
|
||||
</modules>
|
||||
</component>
|
||||
</project>
|
||||
|
|
|
@ -2,8 +2,8 @@
|
|||
<project version="4">
|
||||
<component name="FileEditorManager">
|
||||
<leaf>
|
||||
<file leaf-file-name="audio_player.dart" pinned="false" current-in-tab="true">
|
||||
<entry file="file://$PROJECT_DIR$/lib/audio_player.dart">
|
||||
<file leaf-file-name="just_audio.dart" pinned="false" current-in-tab="true">
|
||||
<entry file="file://$PROJECT_DIR$/lib/just_audio.dart">
|
||||
<provider selected="true" editor-type-id="text-editor">
|
||||
<state relative-caret-position="0">
|
||||
<caret line="0" column="0" lean-forward="false" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
# audio_player
|
||||
# just_audio
|
||||
|
||||
A new Flutter audio player plugin designed to support background playback with [audio_service](https://pub.dev/packages/audio_service)
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
group 'com.ryanheise.audio_player'
|
||||
group 'com.ryanheise.just_audio'
|
||||
version '1.0'
|
||||
|
||||
buildscript {
|
||||
|
|
|
@ -1 +1 @@
|
|||
rootProject.name = 'audio_player'
|
||||
rootProject.name = 'just_audio'
|
||||
|
|
|
@ -1,3 +1,3 @@
|
|||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
package="com.ryanheise.audio_player">
|
||||
package="com.ryanheise.just_audio">
|
||||
</manifest>
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
package com.ryanheise.audio_player;
|
||||
package com.ryanheise.just_audio;
|
||||
|
||||
import android.media.MediaPlayer;
|
||||
import android.media.MediaTimestamp;
|
||||
|
@ -45,9 +45,9 @@ public class AudioPlayer implements MethodCallHandler, MediaPlayer.OnCompletionL
|
|||
public AudioPlayer(final Registrar registrar, final long id) {
|
||||
this.registrar = registrar;
|
||||
this.id = id;
|
||||
methodChannel = new MethodChannel(registrar.messenger(), "com.ryanheise.audio_player.methods." + id);
|
||||
methodChannel = new MethodChannel(registrar.messenger(), "com.ryanheise.just_audio.methods." + id);
|
||||
methodChannel.setMethodCallHandler(this);
|
||||
eventChannel = new EventChannel(registrar.messenger(), "com.ryanheise.audio_player.events." + id);
|
||||
eventChannel = new EventChannel(registrar.messenger(), "com.ryanheise.just_audio.events." + id);
|
||||
eventChannel.setStreamHandler(new EventChannel.StreamHandler() {
|
||||
@Override
|
||||
public void onListen(final Object arguments, final EventSink eventSink) {
|
|
@ -1,4 +1,4 @@
|
|||
package com.ryanheise.audio_player;
|
||||
package com.ryanheise.just_audio;
|
||||
|
||||
import io.flutter.plugin.common.MethodCall;
|
||||
import io.flutter.plugin.common.MethodChannel;
|
||||
|
@ -6,17 +6,17 @@ import io.flutter.plugin.common.MethodChannel.MethodCallHandler;
|
|||
import io.flutter.plugin.common.MethodChannel.Result;
|
||||
import io.flutter.plugin.common.PluginRegistry.Registrar;
|
||||
|
||||
/** AudioPlayerPlugin */
|
||||
public class AudioPlayerPlugin implements MethodCallHandler {
|
||||
/** JustAudioPlugin */
|
||||
public class JustAudioPlugin implements MethodCallHandler {
|
||||
/** Plugin registration. */
|
||||
public static void registerWith(Registrar registrar) {
|
||||
final MethodChannel channel = new MethodChannel(registrar.messenger(), "com.ryanheise.audio_player.methods");
|
||||
channel.setMethodCallHandler(new AudioPlayerPlugin(registrar));
|
||||
final MethodChannel channel = new MethodChannel(registrar.messenger(), "com.ryanheise.just_audio.methods");
|
||||
channel.setMethodCallHandler(new JustAudioPlugin(registrar));
|
||||
}
|
||||
|
||||
private Registrar registrar;
|
||||
|
||||
public AudioPlayerPlugin(Registrar registrar) {
|
||||
public JustAudioPlugin(Registrar registrar) {
|
||||
this.registrar = registrar;
|
||||
}
|
||||
|
|
@ -1,6 +1,6 @@
|
|||
# audio_player_example
|
||||
# just_audio_example
|
||||
|
||||
Demonstrates how to use the audio_player plugin.
|
||||
Demonstrates how to use the just_audio plugin.
|
||||
|
||||
## Getting Started
|
||||
|
||||
|
|
|
@ -33,7 +33,7 @@ android {
|
|||
|
||||
defaultConfig {
|
||||
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
|
||||
applicationId "com.ryanheise.audio_player_example"
|
||||
applicationId "com.ryanheise.just_audio_example"
|
||||
minSdkVersion 16
|
||||
targetSdkVersion 28
|
||||
versionCode flutterVersionCode.toInteger()
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
package="com.ryanheise.audio_player_example">
|
||||
package="com.ryanheise.just_audio_example">
|
||||
<!-- Flutter needs it to communicate with the running application
|
||||
to allow setting breakpoints, to provide hot reload, etc.
|
||||
-->
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
package="com.ryanheise.audio_player_example">
|
||||
package="com.ryanheise.just_audio_example">
|
||||
|
||||
<!-- io.flutter.app.FlutterApplication is an android.app.Application that
|
||||
calls FlutterMain.startInitialization(this); in its onCreate method.
|
||||
|
@ -8,7 +8,7 @@
|
|||
FlutterApplication and put your custom class here. -->
|
||||
<application
|
||||
android:name="io.flutter.app.FlutterApplication"
|
||||
android:label="audio_player_example"
|
||||
android:label="just_audio_example"
|
||||
android:icon="@mipmap/ic_launcher">
|
||||
<activity
|
||||
android:name=".MainActivity"
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
package com.ryanheise.audio_player_example;
|
||||
package com.ryanheise.just_audio_example;
|
||||
|
||||
import android.os.Bundle;
|
||||
import io.flutter.app.FlutterActivity;
|
|
@ -1,5 +1,5 @@
|
|||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
package="com.ryanheise.audio_player_example">
|
||||
package="com.ryanheise.just_audio_example">
|
||||
<!-- Flutter needs it to communicate with the running application
|
||||
to allow setting breakpoints, to provide hot reload, etc.
|
||||
-->
|
||||
|
|
|
@ -11,7 +11,7 @@
|
|||
<key>CFBundleInfoDictionaryVersion</key>
|
||||
<string>6.0</string>
|
||||
<key>CFBundleName</key>
|
||||
<string>audio_player_example</string>
|
||||
<string>just_audio_example</string>
|
||||
<key>CFBundlePackageType</key>
|
||||
<string>APPL</string>
|
||||
<key>CFBundleShortVersionString</key>
|
||||
|
|
|
@ -4,7 +4,7 @@ import 'package:flutter/material.dart';
|
|||
import 'dart:async';
|
||||
|
||||
import 'package:flutter/services.dart';
|
||||
import 'package:audio_player/audio_player.dart';
|
||||
import 'package:just_audio/just_audio.dart';
|
||||
|
||||
void main() => runApp(MyApp());
|
||||
|
||||
|
|
|
@ -8,7 +8,7 @@ packages:
|
|||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "2.3.0"
|
||||
audio_player:
|
||||
just_audio:
|
||||
dependency: "direct dev"
|
||||
description:
|
||||
path: ".."
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
name: audio_player_example
|
||||
description: Demonstrates how to use the audio_player plugin.
|
||||
name: just_audio_example
|
||||
description: Demonstrates how to use the just_audio plugin.
|
||||
publish_to: 'none'
|
||||
|
||||
dependencies:
|
||||
|
@ -14,7 +14,7 @@ dev_dependencies:
|
|||
flutter_test:
|
||||
sdk: flutter
|
||||
|
||||
audio_player:
|
||||
just_audio:
|
||||
path: ../
|
||||
|
||||
# For information on the generic Dart part of this file, see the
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_test/flutter_test.dart';
|
||||
|
||||
import 'package:audio_player_example/main.dart';
|
||||
import 'package:just_audio_example/main.dart';
|
||||
|
||||
void main() {
|
||||
testWidgets('Verify Platform version', (WidgetTester tester) async {
|
||||
|
|
|
@ -1,4 +0,0 @@
|
|||
#import <Flutter/Flutter.h>
|
||||
|
||||
@interface AudioPlayerPlugin : NSObject<FlutterPlugin>
|
||||
@end
|
|
@ -0,0 +1,4 @@
|
|||
#import <Flutter/Flutter.h>
|
||||
|
||||
@interface JustAudioPlugin : NSObject<FlutterPlugin>
|
||||
@end
|
|
@ -1,11 +1,11 @@
|
|||
#import "AudioPlayerPlugin.h"
|
||||
#import "JustAudioPlugin.h"
|
||||
|
||||
@implementation AudioPlayerPlugin
|
||||
@implementation JustAudioPlugin
|
||||
+ (void)registerWithRegistrar:(NSObject<FlutterPluginRegistrar>*)registrar {
|
||||
FlutterMethodChannel* channel = [FlutterMethodChannel
|
||||
methodChannelWithName:@"audio_player"
|
||||
methodChannelWithName:@"just_audio"
|
||||
binaryMessenger:[registrar messenger]];
|
||||
AudioPlayerPlugin* instance = [[AudioPlayerPlugin alloc] init];
|
||||
JustAudioPlugin* instance = [[JustAudioPlugin alloc] init];
|
||||
[registrar addMethodCallDelegate:instance channel:channel];
|
||||
}
|
||||
|
|
@ -2,7 +2,7 @@
|
|||
# To learn more about a Podspec see http://guides.cocoapods.org/syntax/podspec.html
|
||||
#
|
||||
Pod::Spec.new do |s|
|
||||
s.name = 'audio_player'
|
||||
s.name = 'just_audio'
|
||||
s.version = '0.0.1'
|
||||
s.summary = 'A new flutter plugin project.'
|
||||
s.description = <<-DESC
|
|
@ -45,11 +45,11 @@ import 'package:rxdart/rxdart.dart';
|
|||
/// whatever state the player was in prior to the seek request.
|
||||
class AudioPlayer {
|
||||
static final _mainChannel =
|
||||
MethodChannel('com.ryanheise.audio_player.methods');
|
||||
MethodChannel('com.ryanheise.just_audio.methods');
|
||||
|
||||
static Future<MethodChannel> _createChannel(int id) async {
|
||||
await _mainChannel.invokeMethod('init', id);
|
||||
return MethodChannel('com.ryanheise.audio_player.methods.$id');
|
||||
return MethodChannel('com.ryanheise.just_audio.methods.$id');
|
||||
}
|
||||
|
||||
final Future<MethodChannel> _channel;
|
||||
|
@ -75,7 +75,7 @@ class AudioPlayer {
|
|||
AudioPlayer._internal(DateTime.now().microsecondsSinceEpoch);
|
||||
|
||||
AudioPlayer._internal(this._id) : _channel = _createChannel(_id) {
|
||||
_eventChannelStream = EventChannel('com.ryanheise.audio_player.events.$_id')
|
||||
_eventChannelStream = EventChannel('com.ryanheise.just_audio.events.$_id')
|
||||
.receiveBroadcastStream()
|
||||
.map((data) => _audioPlayerState = AudioPlayerState(
|
||||
state: AudioPlaybackState.values[data[0]],
|
||||
|
@ -136,7 +136,7 @@ class AudioPlayer {
|
|||
return await setFilePath(file.path);
|
||||
}
|
||||
|
||||
Future<File> get _cacheFile async => File(p.join((await getTemporaryDirectory()).path, 'audio_player_asset_cache', '$_id'));
|
||||
Future<File> get _cacheFile async => File(p.join((await getTemporaryDirectory()).path, 'just_audio_asset_cache', '$_id'));
|
||||
|
||||
/// Plays the currently loaded media from the current position. It is legal
|
||||
/// to invoke this method only from one of the following states:
|
|
@ -1,4 +1,4 @@
|
|||
name: audio_player
|
||||
name: just_audio
|
||||
description: Flutter plugin to play audio from streams, files and assets. Works with audio_service to play audio in the background.
|
||||
version: 0.0.1
|
||||
author: Ryan Heise <ryan@ryanheise.com>
|
||||
|
@ -28,8 +28,8 @@ flutter:
|
|||
# be modified. They are used by the tooling to maintain consistency when
|
||||
# adding or updating assets for this project.
|
||||
plugin:
|
||||
androidPackage: com.ryanheise.audio_player
|
||||
pluginClass: AudioPlayerPlugin
|
||||
androidPackage: com.ryanheise.just_audio
|
||||
pluginClass: JustAudioPlugin
|
||||
|
||||
# To add assets to your plugin package, add an assets section, like this:
|
||||
# assets:
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
import 'package:flutter/services.dart';
|
||||
import 'package:flutter_test/flutter_test.dart';
|
||||
import 'package:audio_player/audio_player.dart';
|
||||
import 'package:just_audio/just_audio.dart';
|
||||
|
||||
void main() {
|
||||
const MethodChannel channel = MethodChannel('audio_player');
|
||||
const MethodChannel channel = MethodChannel('just_audio');
|
||||
|
||||
setUp(() {
|
||||
channel.setMockMethodCallHandler((MethodCall methodCall) async {
|
Loading…
Reference in New Issue