An electronic apparatus with a battery built therein, wherein the electronic apparatus comprises: a data and charging port, a direct current charging port, a data interface, a power switch, a charging management module, a main processor, a video receiver, and a video processing module; the data and charging port is configured to transfer electric energy or transmit video data; the direct current charging port is configured to transfer electric energy; the data interface is configured to transmit video data; the power switch is configured to detect whether the data and charging port or the direct current charging port is transferring electric energy, and enable a conduction between the data and charging port or the direct current charging port and the charging management module according to a detection result, the charging management module, after the charging management module becomes in conduction with the data and charging port or the direct current charging port, employs the data and charging port or the direct current charging port to charge the battery; and the main processor is configured to control the video receiver to detect whether the data and charging port or the data interface is transmitting video data, receive the video data from either of them according to a detection result, and send the received video data to the video processing module for processing, characterized in that the power switch comprises a threshold detection circuit, an inverter, a comparator, and a switch transistor; the threshold detection circuit is configured to detect a potential of the data and charging port; the inverter is configured to acquire the potential of the data and charging port or a potential of the direct current charging port, and input a corresponding reverse potential; the comparator is configured to compare the reverse potential of the data and charging port and the potential of the direct current charging port, or compare the potential of the data and charging port and the reverse potential of the direct current charging port, and a potential of a comparison result controls the switch transistor to turn on or off; the switch transistor turning on or off causes a connection or disconnection between the data and charging port or the direct current charging port and the charging management module. the data and charging port is configured to transfer electric energy or transmit video data; the direct current charging port is configured to transfer electric energy; the data interface is configured to transmit video data; the power switch is configured to detect whether the data and charging port or the direct current charging port is transferring electric energy, and enable a conduction between the data and charging port or the direct current charging port and the charging management module according to a detection result, the charging management module, after the charging management module becomes in conduction with the data and charging port or the direct current charging port, employs the data and charging port or the direct current charging port to charge the battery; and the main processor is configured to control the video receiver to detect whether the data and charging port or the data interface is transmitting video data, receive the video data from either of them according to a detection result, and send the received video data to the video processing module for processing, characterized in that the power switch comprises a threshold detection circuit, an inverter, a comparator, and a switch transistor; the threshold detection circuit is configured to detect a potential of the data and charging port; the inverter is configured to acquire the potential of the data and charging port or a potential of the direct current charging port, and input a corresponding reverse potential; the comparator is configured to compare the reverse potential of the data and charging port and the potential of the direct current charging port, or compare the potential of the data and charging port and the reverse potential of the direct current charging port, and a potential of a comparison result controls the switch transistor to turn on or off; the switch transistor turning on or off causes a connection or disconnection between the data and charging port or the direct current charging port and the charging management module.