We propose in this paper a context-aware adaptation technique for SMIL encoded multimedia documents. Our approach is mainly dedicated to run in compiletime but we discuss also how it can be used in runtime. Our algorithm aims at improving the execution of a multimedia presentation. This is achieved by scheduling object prefetchings in the presentation while monitoring bandwidth and memory space availabilities. For this effect, a request pattern computed from the temporal graph of the SMIL specification is exploited in order to apply an optimal policy to select which objects should be pre-fetched, real time delivered or discarded, even. The algorithm can be used as a tool to evaluate and to monitor the QoS of a presentation. At compile time, it makes it possible to assess whether the QoS of a presentation can be guaranteed after enforcing specific context-oriented adaptations. At authoring stage, this algorithm can be used, for instance, to produce different alternative sub-codes, such that each one is adapted to run in a specific context. In runtime, the algorithm can provide a mechanism to monitor the elastic time computation in case of a mismatch occurrence. In order to advocate our proposal, some experimentation results performed on a simulation platform are reported.