Rename project to just_audio

This commit is contained in:
Ryan Heise 2019-11-28 17:55:32 +11:00
parent 0574c041c5
commit 108821871d
27 changed files with 51 additions and 51 deletions

View File

@ -2,9 +2,9 @@
<project version="4"> <project version="4">
<component name="ProjectModuleManager"> <component name="ProjectModuleManager">
<modules> <modules>
<module fileurl="file://$PROJECT_DIR$/audio_player.iml" filepath="$PROJECT_DIR$/audio_player.iml" /> <module fileurl="file://$PROJECT_DIR$/just_audio.iml" filepath="$PROJECT_DIR$/just_audio.iml" />
<module fileurl="file://$PROJECT_DIR$/android/audio_player_android.iml" filepath="$PROJECT_DIR$/android/audio_player_android.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/audio_player_example_android.iml" filepath="$PROJECT_DIR$/example/android/audio_player_example_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> </modules>
</component> </component>
</project> </project>

View File

@ -2,8 +2,8 @@
<project version="4"> <project version="4">
<component name="FileEditorManager"> <component name="FileEditorManager">
<leaf> <leaf>
<file leaf-file-name="audio_player.dart" pinned="false" current-in-tab="true"> <file leaf-file-name="just_audio.dart" pinned="false" current-in-tab="true">
<entry file="file://$PROJECT_DIR$/lib/audio_player.dart"> <entry file="file://$PROJECT_DIR$/lib/just_audio.dart">
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="0"> <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" /> <caret line="0" column="0" lean-forward="false" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />

View File

@ -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) A new Flutter audio player plugin designed to support background playback with [audio_service](https://pub.dev/packages/audio_service)

View File

@ -1,4 +1,4 @@
group 'com.ryanheise.audio_player' group 'com.ryanheise.just_audio'
version '1.0' version '1.0'
buildscript { buildscript {

View File

@ -1 +1 @@
rootProject.name = 'audio_player' rootProject.name = 'just_audio'

View File

@ -1,3 +1,3 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android" <manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.ryanheise.audio_player"> package="com.ryanheise.just_audio">
</manifest> </manifest>

View File

@ -1,4 +1,4 @@
package com.ryanheise.audio_player; package com.ryanheise.just_audio;
import android.media.MediaPlayer; import android.media.MediaPlayer;
import android.media.MediaTimestamp; import android.media.MediaTimestamp;
@ -45,9 +45,9 @@ public class AudioPlayer implements MethodCallHandler, MediaPlayer.OnCompletionL
public AudioPlayer(final Registrar registrar, final long id) { public AudioPlayer(final Registrar registrar, final long id) {
this.registrar = registrar; this.registrar = registrar;
this.id = id; 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); 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() { eventChannel.setStreamHandler(new EventChannel.StreamHandler() {
@Override @Override
public void onListen(final Object arguments, final EventSink eventSink) { public void onListen(final Object arguments, final EventSink eventSink) {

View File

@ -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.MethodCall;
import io.flutter.plugin.common.MethodChannel; 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.MethodChannel.Result;
import io.flutter.plugin.common.PluginRegistry.Registrar; import io.flutter.plugin.common.PluginRegistry.Registrar;
/** AudioPlayerPlugin */ /** JustAudioPlugin */
public class AudioPlayerPlugin implements MethodCallHandler { public class JustAudioPlugin implements MethodCallHandler {
/** Plugin registration. */ /** Plugin registration. */
public static void registerWith(Registrar registrar) { public static void registerWith(Registrar registrar) {
final MethodChannel channel = new MethodChannel(registrar.messenger(), "com.ryanheise.audio_player.methods"); final MethodChannel channel = new MethodChannel(registrar.messenger(), "com.ryanheise.just_audio.methods");
channel.setMethodCallHandler(new AudioPlayerPlugin(registrar)); channel.setMethodCallHandler(new JustAudioPlugin(registrar));
} }
private Registrar registrar; private Registrar registrar;
public AudioPlayerPlugin(Registrar registrar) { public JustAudioPlugin(Registrar registrar) {
this.registrar = registrar; this.registrar = registrar;
} }

View File

@ -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 ## Getting Started

View File

@ -33,7 +33,7 @@ android {
defaultConfig { defaultConfig {
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html). // 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 minSdkVersion 16
targetSdkVersion 28 targetSdkVersion 28
versionCode flutterVersionCode.toInteger() versionCode flutterVersionCode.toInteger()

View File

@ -1,5 +1,5 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android" <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 <!-- Flutter needs it to communicate with the running application
to allow setting breakpoints, to provide hot reload, etc. to allow setting breakpoints, to provide hot reload, etc.
--> -->

View File

@ -1,5 +1,5 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android" <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 <!-- io.flutter.app.FlutterApplication is an android.app.Application that
calls FlutterMain.startInitialization(this); in its onCreate method. calls FlutterMain.startInitialization(this); in its onCreate method.
@ -8,7 +8,7 @@
FlutterApplication and put your custom class here. --> FlutterApplication and put your custom class here. -->
<application <application
android:name="io.flutter.app.FlutterApplication" android:name="io.flutter.app.FlutterApplication"
android:label="audio_player_example" android:label="just_audio_example"
android:icon="@mipmap/ic_launcher"> android:icon="@mipmap/ic_launcher">
<activity <activity
android:name=".MainActivity" android:name=".MainActivity"

View File

@ -1,4 +1,4 @@
package com.ryanheise.audio_player_example; package com.ryanheise.just_audio_example;
import android.os.Bundle; import android.os.Bundle;
import io.flutter.app.FlutterActivity; import io.flutter.app.FlutterActivity;

View File

@ -1,5 +1,5 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android" <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 <!-- Flutter needs it to communicate with the running application
to allow setting breakpoints, to provide hot reload, etc. to allow setting breakpoints, to provide hot reload, etc.
--> -->

View File

@ -11,7 +11,7 @@
<key>CFBundleInfoDictionaryVersion</key> <key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string> <string>6.0</string>
<key>CFBundleName</key> <key>CFBundleName</key>
<string>audio_player_example</string> <string>just_audio_example</string>
<key>CFBundlePackageType</key> <key>CFBundlePackageType</key>
<string>APPL</string> <string>APPL</string>
<key>CFBundleShortVersionString</key> <key>CFBundleShortVersionString</key>

View File

@ -4,7 +4,7 @@ import 'package:flutter/material.dart';
import 'dart:async'; import 'dart:async';
import 'package:flutter/services.dart'; import 'package:flutter/services.dart';
import 'package:audio_player/audio_player.dart'; import 'package:just_audio/just_audio.dart';
void main() => runApp(MyApp()); void main() => runApp(MyApp());

View File

@ -8,7 +8,7 @@ packages:
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "2.3.0" version: "2.3.0"
audio_player: just_audio:
dependency: "direct dev" dependency: "direct dev"
description: description:
path: ".." path: ".."

View File

@ -1,5 +1,5 @@
name: audio_player_example name: just_audio_example
description: Demonstrates how to use the audio_player plugin. description: Demonstrates how to use the just_audio plugin.
publish_to: 'none' publish_to: 'none'
dependencies: dependencies:
@ -14,7 +14,7 @@ dev_dependencies:
flutter_test: flutter_test:
sdk: flutter sdk: flutter
audio_player: just_audio:
path: ../ path: ../
# For information on the generic Dart part of this file, see the # For information on the generic Dart part of this file, see the

View File

@ -8,7 +8,7 @@
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_test/flutter_test.dart'; import 'package:flutter_test/flutter_test.dart';
import 'package:audio_player_example/main.dart'; import 'package:just_audio_example/main.dart';
void main() { void main() {
testWidgets('Verify Platform version', (WidgetTester tester) async { testWidgets('Verify Platform version', (WidgetTester tester) async {

View File

@ -1,4 +0,0 @@
#import <Flutter/Flutter.h>
@interface AudioPlayerPlugin : NSObject<FlutterPlugin>
@end

View File

@ -0,0 +1,4 @@
#import <Flutter/Flutter.h>
@interface JustAudioPlugin : NSObject<FlutterPlugin>
@end

View File

@ -1,11 +1,11 @@
#import "AudioPlayerPlugin.h" #import "JustAudioPlugin.h"
@implementation AudioPlayerPlugin @implementation JustAudioPlugin
+ (void)registerWithRegistrar:(NSObject<FlutterPluginRegistrar>*)registrar { + (void)registerWithRegistrar:(NSObject<FlutterPluginRegistrar>*)registrar {
FlutterMethodChannel* channel = [FlutterMethodChannel FlutterMethodChannel* channel = [FlutterMethodChannel
methodChannelWithName:@"audio_player" methodChannelWithName:@"just_audio"
binaryMessenger:[registrar messenger]]; binaryMessenger:[registrar messenger]];
AudioPlayerPlugin* instance = [[AudioPlayerPlugin alloc] init]; JustAudioPlugin* instance = [[JustAudioPlugin alloc] init];
[registrar addMethodCallDelegate:instance channel:channel]; [registrar addMethodCallDelegate:instance channel:channel];
} }

View File

@ -2,7 +2,7 @@
# To learn more about a Podspec see http://guides.cocoapods.org/syntax/podspec.html # To learn more about a Podspec see http://guides.cocoapods.org/syntax/podspec.html
# #
Pod::Spec.new do |s| Pod::Spec.new do |s|
s.name = 'audio_player' s.name = 'just_audio'
s.version = '0.0.1' s.version = '0.0.1'
s.summary = 'A new flutter plugin project.' s.summary = 'A new flutter plugin project.'
s.description = <<-DESC s.description = <<-DESC

View File

@ -45,11 +45,11 @@ import 'package:rxdart/rxdart.dart';
/// whatever state the player was in prior to the seek request. /// whatever state the player was in prior to the seek request.
class AudioPlayer { class AudioPlayer {
static final _mainChannel = static final _mainChannel =
MethodChannel('com.ryanheise.audio_player.methods'); MethodChannel('com.ryanheise.just_audio.methods');
static Future<MethodChannel> _createChannel(int id) async { static Future<MethodChannel> _createChannel(int id) async {
await _mainChannel.invokeMethod('init', id); 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; final Future<MethodChannel> _channel;
@ -75,7 +75,7 @@ class AudioPlayer {
AudioPlayer._internal(DateTime.now().microsecondsSinceEpoch); AudioPlayer._internal(DateTime.now().microsecondsSinceEpoch);
AudioPlayer._internal(this._id) : _channel = _createChannel(_id) { AudioPlayer._internal(this._id) : _channel = _createChannel(_id) {
_eventChannelStream = EventChannel('com.ryanheise.audio_player.events.$_id') _eventChannelStream = EventChannel('com.ryanheise.just_audio.events.$_id')
.receiveBroadcastStream() .receiveBroadcastStream()
.map((data) => _audioPlayerState = AudioPlayerState( .map((data) => _audioPlayerState = AudioPlayerState(
state: AudioPlaybackState.values[data[0]], state: AudioPlaybackState.values[data[0]],
@ -136,7 +136,7 @@ class AudioPlayer {
return await setFilePath(file.path); 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 /// Plays the currently loaded media from the current position. It is legal
/// to invoke this method only from one of the following states: /// to invoke this method only from one of the following states:

View File

@ -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. 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 version: 0.0.1
author: Ryan Heise <ryan@ryanheise.com> author: Ryan Heise <ryan@ryanheise.com>
@ -28,8 +28,8 @@ flutter:
# be modified. They are used by the tooling to maintain consistency when # be modified. They are used by the tooling to maintain consistency when
# adding or updating assets for this project. # adding or updating assets for this project.
plugin: plugin:
androidPackage: com.ryanheise.audio_player androidPackage: com.ryanheise.just_audio
pluginClass: AudioPlayerPlugin pluginClass: JustAudioPlugin
# To add assets to your plugin package, add an assets section, like this: # To add assets to your plugin package, add an assets section, like this:
# assets: # assets:

View File

@ -1,9 +1,9 @@
import 'package:flutter/services.dart'; import 'package:flutter/services.dart';
import 'package:flutter_test/flutter_test.dart'; import 'package:flutter_test/flutter_test.dart';
import 'package:audio_player/audio_player.dart'; import 'package:just_audio/just_audio.dart';
void main() { void main() {
const MethodChannel channel = MethodChannel('audio_player'); const MethodChannel channel = MethodChannel('just_audio');
setUp(() { setUp(() {
channel.setMockMethodCallHandler((MethodCall methodCall) async { channel.setMockMethodCallHandler((MethodCall methodCall) async {