How do I play a youtube video in MATLAB App designer using HTML?
Afficher commentaires plus anciens
I am trying to embed and play a Youtube video using the HTML Component in the App Designer but am unable to do so. Is this even possible with the current 2020a release?
8 commentaires
Geoff Hayes
le 11 Juin 2020
Aditya - what is the code that you are using to embed and play the video? Does the HTML code include something similar to
<iframe width="420" height="315"
src="https://www.youtube.com/linkToSomeVideo/videoId">
</iframe>
?
AT
le 11 Juin 2020
Mohammad Sami
le 12 Juin 2020
I tested on R2020a using iframe embde code with uihtml. but it just shows blank screen.
AT
le 12 Juin 2020
Mohammad Sami
le 12 Juin 2020
I checked the documentations, following are currently listead as the limitations inluding embed code.
Limitations
- You cannot link to URL web resources or embed applications from external web pages using the uihtml function.
- HTML files that you specify for the HTMLSource property cannot access third-party JavaScript libraries by way of a Content Delivery Network (CDN). Save libraries in a location that your local file system can access.
- Common web file types, like JavaScript and CSS, can be referenced from the HTML file you specify for the HTMLSource property, but other web file types might not be supported.
- Content cannot overflow the bounds of the HTML UI component. If you are creating dynamic content, like pop-up widgets, make the size of your HTML UI component large enough to display the widget when the pop-up is in its opened state.
- On MATLAB desktop, certain HTML features such as web plugins and access to webcams or microphones are not supported.
- You cannot set the HTMLSource property to an HTML file that has query parameters appended to its file name. As a workaround, set these parameters in htmlComponent.Data.
- Hyperlinks with matlab: operations are not supported.
mohammad Dezfoulian
le 8 Juin 2021
Mohammad, From where have you got this limitation note?
Mohammad Sami
le 15 Juin 2021
The limitations are specified in the documentation.
https://www.mathworks.com/help/matlab/ref/uihtml.html
IFM
le 14 Avr 2023
Did you ever find a work around? I am looking to do the same thing.
Réponses (1)
Rushikesh
le 11 Oct 2024
0 votes
As of now, MATLAB R2020a does not support embedding of external web page such as youtube videos in html component. As mentioned in MATLAB Documentation.
One possible workaround is to download the video locally that you want to play as embedded and place it in same or sub folder of your HTML file. Then reference that video from you HTML file.
Catégories
En savoir plus sur Package and Share Apps dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!