Method and system for playing video on a mobile device
View Patent ↗The invention provides a system and a method for automatically switching from a local storage to a remote storage for recording a broadcast video stream, the switching being triggered by the fact that the local storage is almost full, and for automatically switching from a local storage to a remote storage for playing a broadcast video stream in a delayed manner, the switching being triggered by the fact that the video frames in the local storage are exhausted.
1. A method for playing video frames, each of the frames being associated with a numeric identifier, comprising:
receiving an input stream of a plurality of video frames from a broadcast server, the plurality of video frames including a first frame associated with a first identifier;
storing the plurality of video frames including the first frame in a first queue;
playing the plurality of video frames by dequeuing the plurality of video frames from the first queue;
detecting a first event when the dequeuing of video frames from the first queue is halted;
detecting a second event when the first queue load is above a first predefined threshold;
sending a first message to an output message handler, the first message instructing the recording of the video frames from the broadcast server in a second external queue, the second external queue being hosted on an external server;
receiving a second message indicating that a second frame associated with a second identifier has been stored in the second external queue;
detecting a third event when dequeuing of video frames from the first queue has started; and
sending a third message to the output message handler instructing the external server to stream the previously recorded video frames.
2. The method of claim 1 , wherein, at the step of sending a third message, the video frames sent by the external server are associated with a further identifier having a numeric value greater than or equal to the numeric value of the second identifier.
3. The method of claim 1 , further comprising, after the step of receiving a second message, the step of discarding the video frames whose associated identifier has a numeric value greater than or equal to the numeric value of the second identifier.
4. The method of claim 1 , further comprising the step of receiving a third frame associated with a third identifier from the second input stream.
5. The method of claim 1 , further comprising: after the step of detecting a third event, the step of detecting a fourth event when the first queue load is below a second predefined threshold.
6. An apparatus for playing video frames, each of the frames being associated with a numeric identifier, comprising:
a computer device, including:
a component for receiving an input stream of a plurality of video frames from a broadcast server, the plurality of video frames including a first frame associated with a first identifier;
a component for storing the plurality of video frames including the first frame in a first queue;
a component for playing the plurality of video frames by dequeuing the plurality of video frames from the first queue;
a component for detecting a first event when the dequeuing of video frames from the first queue is halted;
a component for detecting a second event when the first queue load is above a first predefined threshold;
a component for sending a first message to an output message handler, the first message instructing the recording of the video frames from the broadcast server in a second external queue, the second external queue being hosted on an external server;
a component for receiving a second message indicating that a second frame associated with a second identifier has been stored in the second external queue;
a component for detecting a third event when dequeuing of video frames from the first queue has started; and
a component for sending a third message to the output message handler instructing the external server to stream the previously recorded video frames.
7. A computer program product stored on a non-transitory computer readable storage medium and loadable into the internal memory of a computing device, comprising software code portions for performing, when said product is run on a computer, a method comprising:
receiving an input stream of a plurality of video frames from a broadcast server, the plurality of video frames including a first frame associated with a first identifier;
storing the plurality of video frames including the first frame in a first queue;
playing the plurality of video frames by dequeuing the plurality of video frames from the first queue;
detecting a first event when the dequeuing of video frames from the first queue is halted;
detecting a second event when the first queue load is above a first predefined threshold;
sending a first message to an output message handler, the first message instructing the recording of the video frames from the broadcast server in a second external queue, the second external queue being hosted on an external server;
receiving a second message indicating that a second frame associated with a second identifier has been stored in the second external queue;
detecting a third event when dequeuing of video frames from the first queue has started; and
sending a third message to the output message handler instructing the external server to stream the previously recorded video frames.