@ekcb ,Em , You say it is working now when plugged in, It is possible the battery is failing, maybe the charger failing or not connected quite properly is the battery showing full charge now. If battery showing full charge you may just have to brave it, unplug and see if it will run on battery if showing charged if it does not run on battery, battery or connection likely faulty. Link to battery removal below,battery can be tested with DVOM to see if it is holding a charge and check all connections. Try another compatible charger if battery low and check the charge port for dust/lint etc. and clean out, look inside port for any damage terminals and straighten with tooth pick very carefully, also with cord plugged in note whether port tries to wiggle/loose as this could be the fault needing repair. Good luck.
I hope this helped you out, if so let me know by pressing the helpful button.
https://www.youtube.com/watch?v=g3pcd5f4gDo