Closed mvtglobally closed 2 years ago
Doubled price to $16000 https://www.upwork.com/jobs/~0103b194cebb2bdef4
it is a back-end issue, you can fix it by following this blog, it worked fine on safari browser without any issues.
you can test using this endpoint https://lionfish-app-nvp9x.ondigitalocean.app/video?uri=
, i will let it for one day if someone would like to test.
Thanks, @gladiator-1, looks like this resolves the issue for iOS Safari. I can see the proposal is fragmented into multiple comments. Would you mind sharing it with steps in one single comment, so that I can review and decide on that?
Web :
createElement
from react-native
to create HTML <video>
element.Native :
<video>
element inside a webview using RNWV(react-native-webview) and inline HTML.react-native-video
with react-native-video-player
, I don't see huge differences between both react-native-video or RNWV we can decide which one is better while implementation.Web :
<video>
element is the simplest way to play a video file, it can play the uploaded videos inline without the need to use extra lib.Native :
Web :
Web
Native (react-native-web-view
)
Native (react-native-video
and react-native-video-player
Thanks, @gladiator-1. This was really helpful.
@stitesExpensify Based on the previous discussions, I am inclined with @gladiator-1's proposal of not using external lib. Do we need provisions to play Youtube/Vimeo files at the moment?
@mananjadhav, @mallenexpensify, @stitesExpensify Eep! 4 days overdue now. Issues have feelings too...
@stitesExpensify can you review @mananjadhav comment above? https://github.com/Expensify/App/issues/7835#issuecomment-1131201855
@stitesExpensify is out sick so he might not be able to review til next week
I am inclined with @gladiator-1's proposal of not using external lib
I agree
Do we need provisions to play Youtube/Vimeo files at the moment?
I don't think so, but i'll double check with the product team.
@gladiator-1 I noticed in your cons
you only mentioned needing an external library for web to play youtube videos, is that correct? Or would we have the same problem on mobile?
would we have the same problem on mobile?
No, we can use a third party script inside the react-native web view and play Youtube/Vimeo videos.
Okay then, for now let's just stick to the non-library implementation and we can add the required library for web in the future if that becomes a priority!
@stitesExpensify Adding a comment for a proper confirmation. That we're going ahead with @gladiator-1's proposal.
π π π C+ reviewed
Yep, moving ahead with @gladiator-1's proposal!
π£ @gladiator-1 You have been assigned to this job by @mallenexpensify! Please apply to this job in Upwork and leave a comment on the Github issue letting us know when we can expect a PR to be ready for review π§βπ» Keep in mind: Code of Conduct | Contributing π
@gladiator-1 can you please apply for the job here and confirm once you have? https://www.upwork.com/jobs/~0103b194cebb2bdef4
@mallenexpensify applied with code "4635"
Hired @gladiator-1 and @mananjadhav in Upwork!
Not overdue, just hired a contributor
on small screen Android devices,: when we go back from ReportScreen
, componentWillUnmount
inside the ReportScreen
won't call, there's nothing happens, we are actually on the same screen and only closing and opening the drawer, so if we play any video inside the ReportScreen
and go back the video is still playing, to fix it we can put a webview video container as a video thumbnail in ReportScreen
when we pressing it, it open a react-native-modal
contains a webview
which contains the video.
demo :
Is it Ok?
Also, we need a back engineer to fix this issue, we can't test on Safari and IOS.
I'm a bit confused, what needs to be done on the back end?
we need to stream portions of the video rather than streaming the entire video, if you download this repo you will find two nodeJS routes, first one is /works-in-chrome
it streams the entire video file, the second one is /works-in-chrome-and-safari
it streams portions of the video, if you start the server you will find that /works-in-chrome
or localhost:3000/works-in-chrome
works on chrome only but localhost:3000/works-in-chrome-and-safari
works on both (chrome and safari), so if our server is a NodeJS server we need to make our route look like /works-in-chrome-and-safar
rather than /works-in-chrome
.
Referance : this blog
Hm okay, got it. I missed it the first time that there were extensive backend changes necessary.
I have 2 questions:
fs.createReadStream(filePath, options);
that we can use? This code worked for me, I got it from this gist
You can check if the request coming from an IOS device and the file format is [mp4,ogg,webM], download the file from s3 and save it in a temp folder, and for every request coming from an IOS device requires a [mp4,ogg,webM] file we check this temp folder first if the file does not exist download it from s3 and save it, then delete this temp folder content every few hours. (this should be considered as a temporary fix, the clients should get their files from s3 directly rather than causing a heavy load on the back end server.)
@gladiator-1 Have you tried react-native-video
for the iOS
playback? I am also guessing it supports streaming via S3.
download the file from s3 and save it in a temp folder, and for every request coming from an IOS device requires a [mp4,ogg,webM] file we check this temp folder first if the file does not exist download it from s3
This isn't a good approach. It won't scale.
@mananjadhav I tried it before and didn't work. I think if the video runs on safari it will 100% run on IOS, the problem isn't in S3
, I uploaded my video to a S3 bucket
, you can play it on safari or any IOS
device, here is the pre-signed URL, (it will be valid for 12 hours)
@gladiator-1 is working on, updating from Daily
to Weekly
cuz it's in progress
I haven't got time to check this. but I'll check if there's a way to stream S3 videos directly to react-native-video
. I read somewhere it does support, need to verify it once.
@stitesExpensify Do we foresee large videos in the platform? Is it absolutely necessary for us to stream partial videos?
@mananjadhav You can play S3
videos on Safari, react-native-webview
or react-native-video
without any issue.
you can test it, should work on Safari without any issue (exp after 12h), So the issue isn't in S3
.
You can play S3 videos on Safari, react-native-webview or react-native-video without any issue.
@gladiator-1 I am a little confused. Please pardon my ignorance, I just want to get it right and get both of us on the same page . Are you saying that the S3 videos play with partial downloads? with react-native-webview
and react-native-video
?
If yes, then do we still need the changes from the backend?
Are you saying that the S3 videos play with partial downloads?
Yes, I think so because it works on Safari and IOS.
do we still need the changes from the backend?
Yes, while we can't play our videos on Safari (as in the following video) we need backend changes because videos not working on Safari = not working on Desktop = not working on IOS.
note: my repo is ready for PR we can test it while we are waiting for the issue to get fixed and let me know if there are any changes required. (you will need to add isVideo method in Str.js
file).
Okay!! So you're saying, the S3 videos that you've tried are working fine on iOS
, Safari
and Mac
, with partial download. The videos hosted by Expensify are the only ones not working. Is my understanding correct?
note: my repo is ready for PR
Let me review this on the weekend.
you will need to add isVideo method in
Str.js
file
For the above change, you can fork and create a PR against expensify-common
. After it is merged, we take the hash and update it expensify/App -> package.json
.
Okay!! So you're saying, the S3 videos that you've tried are working fine on iOS, Safari and Mac, with partial download. The videos hosted by Expensify are the only ones not working. Is my understanding correct?
Exactly, this is what I mean.
you can fork and create a PR against expensify-common.
I did it here, waiting for the merge.
Okay!! So you're saying, the S3 videos that you've tried are working fine on iOS, Safari and Mac, with partial download. > > > The videos hosted by Expensify are the only ones not working. Is my understanding correct?
Exactly, this is what I mean.
Ahh! Thank you. I am assuming directly posting the S3 URL, no Nodejs/PHP server in between.
I am assuming directly posting the S3 URL, no Nodejs/PHP server in between.
If we are using the S3 pre-signed URL, this means our PHP server is only redirecting the request to this URL, what happens is :
test.mp4
".test.mp4
".......
'I have not looked into this yet due to newsletter 7 priorities
I'll be taking a deeper look at the implementation possibilities by next week.
Triggered auto assignment to @JmillsExpensify (External
), see https://stackoverflow.com/c/expensify/questions/8582 for more details.
I have not had a chance to look into this further. This may require extensive internal work and it is not currently a priority.
Agreed, I wonder if we should at least apply the Exported label so that melvin won't keep pushing this back to daily.
hm it looks like the exported label is already on here, so I'm not sure what to do @JmillsExpensify π
Hmm, yeah I guess I'm also unclear what the logic is. Let's see if that worked.
Still not a priority. @stitesExpensify Add anything else I might not be aware of or have missed!
Same as last week. Focusing on n7 to get offline first out the door!
Anyone working on this one ?
@gladiator-1 has provided us with a potential solution but it takes backend effort that we have not yet prioritized. If there is a purely front-end solution that would be preferable, but it doesn't seem like that is the case.
I was working on a front end solution but might take some time will provide you in 1-2 days. It will include.
Any update @jeet-dhandha ?
I am working on a possible front end solution :)
PROPOSAL : Hello Team, Today I Created a Platform Specific Video Player That's Already integrated in a Bare React Native CLI App ( Just Like Expensify )
The integration is now in android only this is just a proof of work I can make iOS and MacOS in short time too!
cc : @stitesExpensify && @JmillsExpensify
To clarify @JalalMitali you wrote an actual video player component? It is purely in JS or is it native? Just trying to get an idea of your proposal since there isn't any code provided
If you havenβt already, check out our contributing guidelines for onboarding and email contributors@expensify.com to request to join our Slack channel!
Action Performed:
Expected Result:
App should play the uploaded videos inline
Actual Result:
User has to download video to play
Workaround:
unknown
Platform:
Where is this issue occurring?
Version Number: 1.1.39-1 Reproducible in staging?: Y Reproducible in production?: Y Logs: https://stackoverflow.com/c/expensify/questions/4856 Notes/Photos/Videos: Any additional supporting documentation
Expensify/Expensify Issue URL: Issue reported by: @murataka Slack conversation: https://expensify.slack.com/archives/C01GTK53T8Q/p1644125263019529
View all open jobs on GitHub