Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Port windows implementation from C# to C++ #731

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

jaimecbernardo
Copy link

@jaimecbernardo jaimecbernardo commented Jun 30, 2021

This PR removes the Windows C# implementation and adds a Windows C++ implementation, for improving performance and supporting more recent versions of react-native-windows.

@@ -16,7 +16,9 @@
"author": "Zhen Wang <[email protected]> (http://blog.zmxv.com)",
"license": "MIT",
"peerDependencies": {
"react-native": ">=0.8.0"
"react": ">=16.8.6",
"react-native": ">=0.60.0-rc.2",
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

does this need to be 64 too?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It might work for previous versions.
There's also the question of other platforms as well, which might support lower versions.
This causes warnings at most.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks for confirming

@chiaramooney
Copy link

@RomualdPercereau Could you take a look at this PR when you have a moment?

Copy link

@chiaramooney chiaramooney left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍


winrt::Windows::Foundation::IAsyncAction RNSound::loadFile(MediaPlayer player,
const std::string &fileName) {
StorageFile file{nullptr};

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this change seems to break loading a file from url. All thats needed is the following before looking for storage folders/storage files:

if (fileName.rfind("http", 0) == 0)
{
    winrt::Windows::Foundation::Uri uri{ winrt::to_hstring(fileName) };
    auto mediaSource = MediaSource::CreateFromUri(uri);
    player.Source(mediaSource);
}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have some changes that would support doing this, but the janeasystems repo doesn't seem to support pull requests from additional contributors.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah thanks for catching that! Let me check and get back to you to see what the best option we have for adding changes to that repo is.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @chrisfromwork , what error or message are you getting when trying to create a pull request? I think it should be possible to open a PR.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changes from @chrisfromwork are now in the PR.

Copy link

@chrisfromwork chrisfromwork Jul 13, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jaimecbernardo I do not see the JameaSystems repo as a repo I can target with a cross fork pr. I am not sure why

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks @chiaramooney and @jaimecbernardo for picking up this uri support change

@chiaramooney
Copy link

@RomualdPercereau Could you take a look at this PR when you have a moment?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants