Changeset 35411


Ignore:
Timestamp:
2021-09-16T11:10:39+12:00 (3 years ago)
Author:
cstephen
Message:

Use unbound audio object.
Update translations.

Location:
main/trunk/model-interfaces-dev/atea
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • main/trunk/model-interfaces-dev/atea/korero-maori-asr/src/App.vue

    r35409 r35411  
    22    <!-- Used to calculate the character size of our monospace font -->
    33    <span class="monospace-font-sizer">ngā tama a rangi</span>
    4 
    5     <audio id="transcriptionAudio" ref="audioPlayer">
    6         <source id="transcriptionAudioSource" ref="audioPlayerSource" />
    7     </audio>
    84
    95    <div class="paper">
     
    7672        return {
    7773            /** @type {{id: String, url: String} | null} */
    78             currentlyLoadedAudio: null
     74            currentlyLoadedAudio: null,
     75            player: new Audio()
    7976        }
    8077    },
     
    8683    }),
    8784    watch: {
    88         playbackState(newValue) {
     85        async playbackState(newValue) {
    8986            if (!newValue.isPlaying) {
    9087                return;
     
    9289
    9390            const transcription = this.transcriptions.get(newValue.id);
    94             loadTranscriptionAudio(this.$refs.audioPlayer, this.$refs.audioPlayerSource, transcription, this.currentlyLoadedAudio);
     91            loadTranscriptionAudio(this.player, transcription, this.currentlyLoadedAudio);
    9592
    9693            let playbackTime = 0;
     
    9996            }
    10097
    101             this.$refs.audioPlayer.currentTime = playbackTime;
    102             this.$refs.audioPlayer.play();
     98            this.player.currentTime = playbackTime;
     99            await this.player.play();
    103100        }//,
    104101        // shouldPlayAudio(newValue) {
     
    112109    },
    113110    mounted() {
    114         pollAudioTime(this.$refs.audioPlayer, this.$store);
     111        pollAudioTime(this.player, this.$store);
    115112    }
    116113}
     
    135132/**
    136133 * Loads an audio file.
     134 * @param {Audio} player The audio player.
    137135 * @param {TranscriptionViewModel} transcription The name of the requested audio file.
    138136 * @param {{id: String, url: String} | null} current The currently loaded audio.
    139137 * @returns {{id: String, url: String}} If a new audio file was loaded, a new audio tracking object, else the current one.
    140138 */
    141 function loadTranscriptionAudio(audioElement, audioElementSource, transcription, current) {
     139function loadTranscriptionAudio(player, transcription, current) {
    142140    if (current == null || current.id !== transcription.id) {
    143141        // TODO: Need to profile on some larger tracks; this may not be worth it? Better to cache a URL object instead?
     
    147145
    148146        const urlObject = URL.createObjectURL(transcription.file);
    149         audioElementSource.src = urlObject;
    150         audioElement.load();
     147        player.src = urlObject;
     148        player.load();
    151149
    152150        return { id: transcription.id, url: urlObject };
  • main/trunk/model-interfaces-dev/atea/resources/interface_atea.properties

    r35407 r35411  
    88atea.TranscriptionItem_ExpandEditor=Playback and Edit
    99atea.TranscriptionItem_Download=Download
    10 atea.TranscriptionItem_DownloadAsText=Download transcription
     10atea.TranscriptionItem_DownloadAsText=Download as text
    1111atea.TranscriptionItem_DownloadAsJson=Download as JSON
    1212atea.TranscriptionItem_DownloadAsWebvtt=Download as WebVTT
  • main/trunk/model-interfaces-dev/atea/resources/interface_atea_mi.properties

    r35407 r35411  
    88atea.TranscriptionItem_ExpandEditor=Purei Ake me te Whakatika
    99atea.TranscriptionItem_Download=Tangohia
    10 atea.TranscriptionItem_DownloadAsText=Tangohia te tuhinga tuhi
     10atea.TranscriptionItem_DownloadAsText=Tangohia hei tuhinga
    1111atea.TranscriptionItem_DownloadAsJson=Tangohia hei JSON
    1212atea.TranscriptionItem_DownloadAsWebvtt=Tangohia hei WebVTT
  • main/trunk/model-interfaces-dev/atea/transform/pages/korero-maori-asr.xsl

    r35407 r35411  
    7373            <strong>We're sorry but the Korero Maori ASR interface doesn't work properly without JavaScript enabled. Please enable it to continue.</strong>
    7474        </noscript>
    75         xxx=<xsl:value-of disable-output-escaping="yes" select="util:getInterfaceText($interface_name, /page/@lang, 'atea.AudioUpload_SelectFileText')" />
    7675       
    7776        <div id="app"></div>
Note: See TracChangeset for help on using the changeset viewer.