Giter Club home page Giter Club logo

nativescript-audioplay's Introduction

Hi there ๐Ÿ‘‹

I'm Yasin from Turkey. I'm,

  • Chief technology officer of a technology company
  • A software architect
  • A full stack developer
  • A DevOps engineer
  • A technology and science enthusiast
  • A C# & JavaScript specialist
  • A Vue.js fan
  • An electronics hobbyist
  • A loving husband and father of two

๐Ÿงพ Recent Activity

  1. ๐ŸŽ‰ Merged PR #1 in mehyaa/Convey
  2. โ—๏ธ Closed issue #1 in mehyaa/vscode-branch-cleanup
  3. ๐Ÿ—ฃ Commented on #1 in mehyaa/vscode-branch-cleanup
  4. ๐Ÿ’ช Opened PR #111 in snatch-dev/Convey
  5. ๐Ÿ’ช Opened PR #93 in opentracing-contrib/csharp-netcore

โšก Stats

GitHub Stats

๐Ÿ”ฅ Streak Stats

GitHub Streak

๐Ÿ† Profile Trophy

Github Profile Trophy

nativescript-audioplay's People

Contributors

mehyaa avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar

nativescript-audioplay's Issues

Allow background audio play on iOs

Hi there, this port is great it just needs background audio when a iOs device is blocked or the screen turns off.

I saw the code at nstudio has been updated to run in this mode and seems to be an easy fix.
The six line change occurs in in ios/player.ts:

playFromUrl function change this:

let audioSession = AVAudioSession.sharedInstance();
let output = audioSession.currentRoute.outputs.lastObject.portType;

to this:

let audioSession = AVAudioSession.sharedInstance();
audioSession.setCategoryWithOptionsError(
  AVAudioSessionCategoryAmbient,
  AVAudioSessionCategoryOptions.DuckOthers
);
let output = audioSession.currentRoute.outputs.lastObject.portType;

and in playFromFile function change this:

let audioSession = AVAudioSession.sharedInstance();
let output = audioSession.currentRoute.outputs.lastObject.portType;
TNS_Player_Log('output', output);

to this:

let audioSession = AVAudioSession.sharedInstance();
audioSession.setCategoryWithOptionsError(
  AVAudioSessionCategoryAmbient,
  AVAudioSessionCategoryOptions.DuckOthers
);
let output = audioSession.currentRoute.outputs.lastObject.portType;
TNS_Player_Log('output', output);

I hope this helps someone else who has to dig around this issue.

check more information at nstudio/nativescript-audio#19

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.