Skip to main content

export class LiteYTEmbed extends HTMLElement { constructor() { super(); this.isIframeLoaded = false; this.setupDom(); } static get observedAttributes() { return ['videoid', 'playlistid', 'videoplay', 'videotitle']; } connectedCallback() { this.addEventListener('pointerover', () => LiteYTEmbed.warmConnections(this), { once: true, }); this.addEventListener('click', () => this.addIframe()); } get videoId() { return encodeURIComponent(this.getAttribute('videoid') || ''); } set videoId(id) { this.setAttribute('videoid', id); } get playlistId() { return encodeURIComponent(this.getAttribute('playlistid') || ''); } set playlistId(id) { this.setAttribute('playlistid', id); } get videoTitle() { return this.getAttribute('videotitle') || 'Video'; } set videoTitle(title) { this.setAttribute('videotitle', title); } get videoPlay() { return this.getAttribute('videoplay') || 'Play'; } set videoPlay(name) { this.setAttribute('videoplay', name); } get videoStartAt() { return this.getAttribute('videoStartAt') || '0'; } get autoLoad() { return this.hasAttribute('autoload'); } get autoPause() { return this.hasAttribute('autopause'); } get noCookie() { return this.hasAttribute('nocookie'); } get posterQuality() { return this.getAttribute('posterquality') || 'hqdefault'; } get posterLoading() { return (this.getAttribute('posterloading') || 'lazy'); } get params() { return `start=${this.videoStartAt}&${this.getAttribute('params')}`; } set params(opts) { this.setAttribute('params', opts); } set posterQuality(opts) { this.setAttribute('posterquality', opts); } get disableNoscript() { return this.hasAttribute('disablenoscript'); } setupDom() { const shadowDom = this.attachShadow({ mode: 'open' }); let nonce = ''; if (window.liteYouTubeNonce) { nonce = `nonce="${window.liteYouTubeNonce}"`; } shadowDom.innerHTML = `
`; this.domRefFrame = shadowDom.querySelector('#frame'); this.domRefImg = { fallback: shadowDom.querySelector('#fallbackPlaceholder'), webp: shadowDom.querySelector('#webpPlaceholder'), jpeg: shadowDom.querySelector('#jpegPlaceholder'), }; this.domRefPlayButton = shadowDom.querySelector('#playButton'); } setupComponent() { const hasImgSlot = this.shadowRoot.querySelector('slot[name=image]'); if (hasImgSlot.assignedNodes().length === 0) { this.initImagePlaceholder(); } this.domRefPlayButton.setAttribute('aria-label', `${this.videoPlay}: ${this.videoTitle}`); this.setAttribute('title', `${this.videoPlay}: ${this.videoTitle}`); if (this.autoLoad || this.isYouTubeShort() || this.autoPause) { this.initIntersectionObserver(); } if (!this.disableNoscript) { this.injectSearchNoScript(); } } attributeChangedCallback(name, oldVal, newVal) { if (oldVal !== newVal) { this.setupComponent(); if (this.domRefFrame.classList.contains('activated')) { this.domRefFrame.classList.remove('activated'); this.shadowRoot.querySelector('iframe').remove(); this.isIframeLoaded = false; } } } injectSearchNoScript() { const eleNoScript = document.createElement('noscript'); this.prepend(eleNoScript); eleNoScript.innerHTML = this.generateIframe(); } generateIframe(isIntersectionObserver = false) { let autoplay = isIntersectionObserver ? 0 : 1; let autoPause = this.autoPause ? '&enablejsapi=1' : ''; const wantsNoCookie = this.noCookie ? '-nocookie' : ''; let embedTarget; if (this.playlistId) { embedTarget = `?listType=playlist&list=${this.playlistId}&`; } else { embedTarget = `${this.videoId}?`; } if (this.isYouTubeShort()) { this.params = `loop=1&mute=1&modestbranding=1&playsinline=1&rel=0&enablejsapi=1&playlist=${this.videoId}`; autoplay = 1; } return ` `; } addIframe(isIntersectionObserver = false) { if (!this.isIframeLoaded) { const iframeHTML = this.generateIframe(isIntersectionObserver); this.domRefFrame.insertAdjacentHTML('beforeend', iframeHTML); this.domRefFrame.classList.add('activated'); this.isIframeLoaded = true; this.attemptShortAutoPlay(); this.dispatchEvent(new CustomEvent('liteYoutubeIframeLoaded', { detail: { videoId: this.videoId, }, bubbles: true, cancelable: true, })); } } initImagePlaceholder() { this.testPosterImage(); this.domRefImg.fallback.setAttribute('aria-label', `${this.videoPlay}: ${this.videoTitle}`); this.domRefImg?.fallback?.setAttribute('alt', `${this.videoPlay}: ${this.videoTitle}`); } async testPosterImage() { setTimeout(() => { const webpUrl = `https://i.ytimg.com/vi_webp/${this.videoId}/${this.posterQuality}.webp`; const img = new Image(); img.fetchPriority = 'low'; img.referrerPolicy = 'origin'; img.src = webpUrl; img.onload = async (e) => { const target = e.target; const noPoster = target?.naturalHeight == 90 && target?.naturalWidth == 120; if (noPoster) { this.posterQuality = 'hqdefault'; } const posterUrlWebp = `https://i.ytimg.com/vi_webp/${this.videoId}/${this.posterQuality}.webp`; this.domRefImg.webp.srcset = posterUrlWebp; const posterUrlJpeg = `https://i.ytimg.com/vi/${this.videoId}/${this.posterQuality}.jpg`; this.domRefImg.fallback.loading = this.posterLoading; this.domRefImg.jpeg.srcset = posterUrlJpeg; this.domRefImg.fallback.src = posterUrlJpeg; this.domRefImg.fallback.loading = this.posterLoading; }; }, 100); } initIntersectionObserver() { const options = { root: null, rootMargin: '0px', threshold: 0, }; const observer = new IntersectionObserver((entries, observer) => { entries.forEach(entry => { if (entry.isIntersecting && !this.isIframeLoaded) { LiteYTEmbed.warmConnections(this); this.addIframe(true); observer.unobserve(this); } }); }, options); observer.observe(this); if (this.autoPause) { const windowPause = new IntersectionObserver((e, o) => { e.forEach(entry => { if (entry.intersectionRatio !== 1) { this.shadowRoot .querySelector('iframe') ?.contentWindow?.postMessage('{"event":"command","func":"pauseVideo","args":""}', '*'); } }); }, { threshold: 1 }); windowPause.observe(this); } } attemptShortAutoPlay() { if (this.isYouTubeShort()) { setTimeout(() => { this.shadowRoot .querySelector('iframe') ?.contentWindow?.postMessage('{"event":"command","func":"' + 'playVideo' + '","args":""}', '*'); }, 2000); } } isYouTubeShort() { return (this.getAttribute('short') === '' && window.matchMedia('(max-width: 40em)').matches); } static addPrefetch(kind, url) { const linkElem = document.createElement('link'); linkElem.rel = kind; linkElem.href = url; linkElem.crossOrigin = 'true'; document.head.append(linkElem); } static warmConnections(context) { if (LiteYTEmbed.isPreconnected || window.liteYouTubeIsPreconnected) return; LiteYTEmbed.addPrefetch('preconnect', 'https://i.ytimg.com/'); LiteYTEmbed.addPrefetch('preconnect', 'https://s.ytimg.com'); if (!context.noCookie) { LiteYTEmbed.addPrefetch('preconnect', 'https://www.youtube.com'); LiteYTEmbed.addPrefetch('preconnect', 'https://www.google.com'); LiteYTEmbed.addPrefetch('preconnect', 'https://googleads.g.doubleclick.net'); LiteYTEmbed.addPrefetch('preconnect', 'https://static.doubleclick.net'); } else { LiteYTEmbed.addPrefetch('preconnect', 'https://www.youtube-nocookie.com'); } LiteYTEmbed.isPreconnected = true; window.liteYouTubeIsPreconnected = true; } } LiteYTEmbed.isPreconnected = false; customElements.define('lite-youtube', LiteYTEmbed); //# sourceMappingURL=lite-youtube.js.map

During graduate school, you'll encounter stressors that can affect your emotional well-being. Understanding how to manage your mental health is the key to staying healthy and succeeding in school.

Managing your mental health as a graduate student

There are steps you can take to care for your health and wellness that can improve not only your well-being, but also your academic performance. Consider creating a plan to manage your health and wellness, either on your own or with a health care provider's help.

It's important to know that you are not alone. There are many offices and resources on campus ready to help. Here are some of the most common challenges that graduate students face, along with helpful tips and resources.

Caring for your well-being

Staying healthy

Putting your health first in graduate or professional school can be difficult with competing responsibilities. Remember, physical and mental health are strongly connected and significantly impact your success in school and life. Staying healthy can help you feel better and manage mental health symptoms.

  • Lifestyle: You might think you're too busy to sleep, eat well, or exercise. But all these things can affect your mental health and academic success. Check out our self-care section for tips on staying healthy on campus.
  • Rackham Student Experience: This guide helps you care for your well-being in grad school. It includes tips for both your physical and mental health. The information can help you navigate the different resources at U-M and in the community.
  • Alcohol and other drugs: Some students use alcohol or other drugs to relieve their mental health symptoms. But, in reality, these substances are more likely to interfere with mental health recovery. The majority of U-M students make wise decisions when it comes to alcohol and other drugs. When problems come up, U-M has resources to help students. They offer support for moderation strategies and can help find substance abuse recovery services.
  • Health care: It's easy to forget or discount regular checkups. University Health & Counseling offers walk-in and scheduled appointments, most of which are covered by your health service fee.
Mental health stigma and disclosure

Deciding to tell others about your mental health can be a hard decision. It may not always be necessary to discuss your mental health challenges. But it might be helpful to think about how it will affect your academics. You may want to consider how you might respond and what, if any, information you choose to share.

  • Telling your professors: Many students choose to keep their mental illness to themselves, even when it is impacting their academic performance. However, as soon as problems begin, you should feel comfortable speaking with your instructor about getting back on track. The earlier these challenges are addressed, the better the chance for success. Services for Students with Disabilities can be helpful if you need extra support related to your mental health.
  • Telling other students: You may worry about the reactions from other students if you talk about your mental health. This is natural. But having a group of supportive friends can help. If you don't have anyone you are comfortable sharing with, consider joining one of the many student mental health groups on campus.
  • Not sure if you should disclose? This exercise will help you weigh the pros and cons of discussing your diagnosis with others.
Finding support while in school

There are many mental health resources available to you and your family on campus and in the Ann Arbor area. For a full list of what is available, visit our resource section.

Stress management

Grades in graduate or professional school are often determined differently from undergraduate classes. You may not even have set due dates for assignments/exams. This means that you need to find strategies to keep your schedule achievable.

Try spreading out your coursework to make it more manageable. Sleeping well can also help improve your stress levels. You might also include stress-reduction strategies in your daily life. Check out our presentations with tips to help you manage your stress:

Please note, you must be logged in to your Umich Google account to access these presentations.

Time management

Graduate school is full of competing priorities. You may be expected to attend classes, teach and research. You may also have other responsibilities. Effective time management is important to your success. It will also help with your mental health.

Many graduate students, and even faculty members, struggle with managing their time well. But practicing these skills can help you stick to your schedule, stay focused, and reduce stress.

Need some tips? See our self-care page for some helpful time management strategies.

Imposter syndrome

Many graduate school students find themselves wondering if they even belong in graduate school. This is known as imposter syndrome. It is particularly common in first-year graduate students. This doubt can lead to anxiety and procrastination. It might lower your confidence or even affect your performance.

Check out this presentation on imposter syndrome. We also offer in-person wellness groups that address many topics, including imposter syndrome. Rackham also offers similar workshops each year. You can search their events to learn more.

Financial stress

Depending on your current needs, you may need to find ways to earn more money during graduate school.

  • Visit the Rackham Graduate School site for employment opportunities. They also have ways to secure additional funding, such as fellowships, grants, and awards. Your program may also have its own job boards.
  • Your professors can be a great resource to learn about any paid opportunities within your program.
  • If you have any health problems, there are many free and low-cost medical and mental health treatment options available to you and your family.

Making Michigan feel like home

Moving to Ann Arbor

Many graduate students have to move to Ann Arbor while in school. Moving to a new place can be hard. In addition to adjusting to the demands of school, you are also making a new place your home. If you are moving with a partner or family, it can be stressful for everyone.

It takes time to adjust to a new city or a new program. Take some time to explore the Ann Arbor area and enjoy all this community has to offer.

Getting settled

Transitioning to graduate school living arrangements can be a source of stress. Here are some ways to make the transition easier.

  • Housing: Many graduate students come from out of state or abroad and need help finding a place to live. Michigan Housing has information on graduate, family, and off-campus housing. Their staff is available to assist you with your questions to make the transition easier.
  • Roommates: If you lived with a roommate in undergraduate school, you know the stress it can sometimes bring. Setting expectations with your roommate and finding ways to share responsibilities can help. If you and your roommate need help with a conflict, you can talk with a Resident Advisor or Hall Director, or visit the Office of Student Conflict Resolution (OSCR) website. They can also help solve problems with landlords or neighbors.
  • Become a part of U-M Graduate Housing: A staff position within U-M Graduate Housing, such as a Community Assistant, may be a housing alternative to consider. Learn more about becoming a live-in staff member in U-M graduate housing.
  • Finding what you need: Many graduate students arrive on campus just before school starts and don't have time to explore their new home. Orientation can help you become more familiar with the area. You can also talk with current graduate students to learn more about Ann Arbor and the U-M campus. The Campus Information Center’s website is great place to get helpful information. It covers everything from where to register to vote, where to find grocery stores and even has the U-M football schedule.
  • Coming prepared: Before arriving on campus, complete this checklist to help you prepare.
Feeling lonely

Graduate students often come from diverse backgrounds and vary in age. You may work long hours or live alone, which might make you feel isolated. While it isn’t always easy, building friendships and a support system is important for your well-being.

  • Connect with students in your program. You likely share similar professional or academic interests. This can be a good starting point for making connections. Finding student organizations in your program can also help.
  • Connect with people outside your program by engaging in activities you enjoy, such as joining a student organization, taking an art class, participating in sports, or volunteering. This helps your well-being and grows your community.
Finding community

Finding friendships and partnerships, especially new ones, isn’t always easy. But connecting with people and finding a support network at U-M is important for your mental well-being.

  • Graduate/family housing: Living on campus in graduate or family housing can be a great way to meet new people with similar lifestyles and interests. Check out Northwood Housing or Munger Residences for graduate student housing options.
  • Graduate programs: Graduate programs are typically small and offer more chances to connect with your classmates. Other students, especially those in your program, can be a great source of friendship and support.
  • Student activities and organizations: Joining a student organization can help you connect with other students who share your interests. With a large student population, U-M has options for almost any interest. To find a group with similar interests to your own, visit Maize Pages.

Stop by events like Festifall or Northfest to learn more about student groups on campus. For activities specific to graduate students, visit the Student Experience on the Rackham Graduate School website.

Parenting

Parenting as a graduate student can be incredibly challenging. The University has options to support student parents academically and socially.

Prioritizing a healthy work/life balance and connecting with other student parents can help manage some of the stress you may be feeling. Use the resources available, like:

  • The Students Caregivers website includes information on childcare, money, social support, health clinics, insurance options and more.
  • Child and Family Care is a starting point for the U-M community to learn about tools to promote work/life balance, including resources to support parents.

Rackham Graduate School has designed a variety of programs and events for parents. These include childcare information, parenting resources, support groups and social events.

Dealing with academic challenges

Academic pressure

Graduate and professional school can be stressful. It takes a lot of effort to balance work, courses and your own needs. In graduate school, you're expected to contribute more. This means that you will likely be conducting more independent work and research.

Your relationship with your advisor may also feel different. It can be scary to think about discussing your mental health with your advisor. You might worry because they review your work or make professional recommendations. This worksheet can help you decide what to share.


Academic support

Graduate programs are typically small and specialized. If you are struggling with your coursework, reach out to your instructors for support. Second-year graduate students can also be a helpful resource. They have completed many of the courses you will be taking and can provide some insights. U-M also offers many free academic resources specifically designed for graduate students.


Working with advisors

Academic advisors play a major role in your graduate school journey. Advisors can provide career guidance, research opportunities, and make recommendations. Most graduate students work closely with their faculty advisors.

Set up meetings with your faculty advisor(s) early in your graduate school journey. This will help you understand their expectations and allow them to provide the most helpful assistance. When meeting with your faculty advisor(s), take time to discuss your progress. This is your chance to plan/revise your goals and get help if you need it.

The mentoring you will receive from your advisor depends on the person. Some expect their students to work on specific projects and provide a lot of support. Others expect their students to develop and work on their projects with little help. Rackham Graduate School has a guide called “How to Get the Mentoring You Want” to help you get the most out of graduate school.

Working with department administrators

Meet with your program administrators at least once during the academic year. Understanding the academic requirements of graduate programs is complicated. They can also change during your academic career. It's important to understand what is required of you to graduate.

Questions to ask your program administrators:

  • Am I meeting my program requirements?
  • Am I on pace to finish my dissertation on time?
  • Am I meeting the requirements of my funding package?

Lastly, you may feel that you're falling behind when, in reality, you are right on track. Staff can help make sure you’re keeping pace to graduate.

Balancing competing priorities

In many graduate programs, grades are not the top priority. Often, they are not the best indicator of success. Research, teaching or other professional activities may matter more.

This does not mean that coursework does not matter. It just means that it must be balanced with other responsibilities.

Talking with your academic advisor, other faculty members, or older graduate students can help you better understand how to balance your time.

Explore more resources