Skip to content

Commit

Permalink
Fixed platform specific code.
Browse files Browse the repository at this point in the history
  • Loading branch information
hyochan committed Aug 20, 2018
1 parent 00a4bda commit 6042245
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 5 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
## 1.0.6
* Fixed bug in platform specific code.
## 1.0.5
* Fixed pug in `seekToPlayer` in `ios`.
## 1.0.3
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ On *Android* you need to add a permission to `AndroidManifest.xml`:
| stopPlayer | | `String` message | Stop playing. |
| pausePlayer | | `String` message | Pause playing. |
| resumePlayer | | `String` message | Resume playing. |
| seekToPlayer | `int sec` position to goTo | `String` message | Seek audio to selected position in seconds. Parameter should be less than audio duration to correctly placed. |
| seekToPlayer | `int milliSecs` position to goTo | `String` message | Seek audio to selected position in seconds. Parameter should be less than audio duration to correctly placed. |

## Subscriptions
| Subscription | Return | Description |
Expand Down Expand Up @@ -134,7 +134,7 @@ String result = await flutterSound.resumePlayer();

#### Seek player
```dart
String result = await flutterSound.seekToPlayer(sec);
String result = await flutterSound.seekToPlayer(miliSecs);
```

#### Setting subscription duration (Optional). 0.01 is default value when not set.
Expand Down
22 changes: 22 additions & 0 deletions example/ios/Podfile.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
PODS:
- Flutter (1.0.0)
- flutter_sound (0.0.1):
- Flutter

DEPENDENCIES:
- Flutter (from `.symlinks/flutter/ios`)
- flutter_sound (from `.symlinks/plugins/flutter_sound/ios`)

EXTERNAL SOURCES:
Flutter:
:path: ".symlinks/flutter/ios"
flutter_sound:
:path: ".symlinks/plugins/flutter_sound/ios"

SPEC CHECKSUMS:
Flutter: 9d0fac939486c9aba2809b7982dfdbb47a7b0296
flutter_sound: ec7c1debf6cd72d44b1270a1f7a999af15ca8113

PODFILE CHECKSUM: 1e5af4103afd21ca5ead147d7b81d06f494f51a2

COCOAPODS: 1.5.3
5 changes: 3 additions & 2 deletions example/lib/main.dart
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import 'package:flutter/material.dart';
import 'package:intl/intl.dart';

import 'dart:io';
import 'dart:async';
import 'dart:convert';

Expand Down Expand Up @@ -118,8 +119,8 @@ class _MyAppState extends State<MyApp> {
print('resumePlayer: $result');
}

void seekToPlayer(int millisecs) async{
int secs = Platform.OS === 'ios' ? millisecs / 1000 : millisecs;
void seekToPlayer(int milliSecs) async{
int secs = Platform.isIOS ? milliSecs / 1000 : milliSecs;

String result = await flutterSound.seekToPlayer(secs);
print('seekToPlayer: $result');
Expand Down
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: flutter_sound
description: Flutter plugin that relates to sound like audio and recorder.
version: 1.0.5
version: 1.0.6
author: dooboolab<[email protected]>
homepage: https://github.com/dooboolab/flutter_sound
environment:
Expand Down

0 comments on commit 6042245

Please sign in to comment.